CN117033754A - Model processing method, device, equipment and storage medium for pushing resources - Google Patents

Model processing method, device, equipment and storage medium for pushing resources Download PDF

Info

Publication number
CN117033754A
CN117033754A CN202211180997.4A CN202211180997A CN117033754A CN 117033754 A CN117033754 A CN 117033754A CN 202211180997 A CN202211180997 A CN 202211180997A CN 117033754 A CN117033754 A CN 117033754A
Authority
CN
China
Prior art keywords
node
sample
graph
original
nodes
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211180997.4A
Other languages
Chinese (zh)
Inventor
郑佳炜
谷皓
易玲玲
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN202211180997.4A priority Critical patent/CN117033754A/en
Publication of CN117033754A publication Critical patent/CN117033754A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/953Querying, e.g. by the use of web search engines
    • G06F16/9535Search customisation based on user profiles and personalisation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/901Indexing; Data structures therefor; Storage structures
    • G06F16/9024Graphs; Linked lists
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • G06N3/088Non-supervised learning, e.g. competitive learning

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Artificial Intelligence (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Biomedical Technology (AREA)
  • Biophysics (AREA)
  • Computational Linguistics (AREA)
  • Evolutionary Computation (AREA)
  • General Health & Medical Sciences (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • Mathematical Physics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application relates to a model processing method, a device, a computer device, a storage medium and a computer program product for resource pushing. The method relates to artificial intelligence technology, and comprises the following steps: for each sample node obtained from the heterogram, at least one path pointing to the sample node from the neighbor node of the sample node is used for obtaining an original subgraph corresponding to the sample node, and an enhancement subgraph corresponding to the sample node is determined; obtaining an original graph coding representation and an enhancement graph coding representation of the sample node according to the original subgraph and the enhancement subgraph by utilizing a graph encoder; the training graph encoder can be applied to resource pushing and improves the accuracy of the resource pushing by combining the matching loss obtained by the similarity between the original graph coding representation of the sample node and the enhancement graph coding representation, the similarity between the original graph coding representation of different sample nodes and the enhancement graph coding representation and the similarity between the object sample node with the connecting edge and the original graph coding representation of the resource sample node.

Description

Model processing method, device, equipment and storage medium for pushing resources
Technical Field
The present application relates to the field of machine learning technology, and in particular, to a method, an apparatus, a computer device, a storage medium, and a computer program product for model processing for resource pushing.
Background
Along with the rapid development of machine learning technology, in order to perform personalized pushing on a user, a specific pushing list is often generated for the user through a collaborative filtering method, namely, a pushing model is constructed by utilizing a certain algorithm based on attribute information and historical behavior data of the user, so that the purpose of personalized pushing is achieved.
However, new users and new articles are continuously generated, and because the interaction information between the new users and the new articles and the existing users and the existing articles is very lack, the traditional collaborative filtering method cannot provide accurate pushing for the new users and the new articles, i.e. cannot solve the problem of cold start pushing.
Disclosure of Invention
In view of the foregoing, it is desirable to provide a model processing method, apparatus, computer device, computer-readable storage medium, and computer program product for resource pushing that can improve the accuracy of resource pushing for newly added objects.
The application provides a model processing method for resource pushing. The method comprises the following steps:
Acquiring an heterogram formed based on interaction of an object and a resource, wherein the heterogram comprises an object node and a resource node;
obtaining sample nodes from the different patterns, and for each sample node, obtaining an original subgraph corresponding to the sample node according to at least one path pointing to the sample node from a neighbor node of the sample node, and carrying out graph data enhancement on the original subgraph to obtain an enhancement subgraph corresponding to the sample node;
respectively carrying out graph coding on the original subgraph and the enhancement subgraph by utilizing a graph coder to obtain an original graph coding representation and an enhancement graph coding representation of the sample node;
calculating a contrast loss according to the similarity between the original graph coding representation and the enhancement graph coding representation of the same sample node, the similarity between the original graph coding representation and the enhancement graph coding representation of each of the different sample nodes, and calculating a matching loss according to the similarity between the object sample node with the connecting edge and the original graph coding representation of the resource sample node;
and combining the comparison loss and the matching loss for model training to obtain a trained graph encoder, wherein the trained graph encoder is used for pushing resources between objects and resources.
The application also provides a model processing device for pushing the resources. The device comprises:
the first acquisition module is used for acquiring an heterogram formed based on interaction of the object and the resource, wherein the heterogram comprises an object node and a resource node;
the second acquisition module is used for acquiring sample nodes from the heterograms, and for each sample node, according to at least one path pointing to the sample node from the neighbor node of the sample node, obtaining an original subgraph corresponding to the sample node, carrying out graph data enhancement on the original subgraph, and obtaining an enhancement subgraph corresponding to the sample node;
the image coding module is used for respectively carrying out image coding on the original subgraph and the enhancement subgraph by utilizing an image coder to obtain an original image coding representation and an enhancement image coding representation of the sample node;
a calculation module, configured to calculate a contrast loss according to a similarity between an original graph coding representation and an enhanced graph coding representation of the same sample node, a similarity between an original graph coding representation and an enhanced graph coding representation of each of the different sample nodes, and calculate a matching loss according to a similarity between an object sample node with a border and an original graph coding representation of a resource sample node;
And the training module is used for carrying out model training by combining the comparison loss and the matching loss to obtain a trained graph encoder, and the trained graph encoder is used for pushing resources between objects and resources.
In one embodiment, the first obtaining module is configured to obtain, based on historical interaction data between an object and a resource, an interaction bipartite graph between an object node representing the object and a resource node representing the resource; obtaining a social relation network graph between object nodes representing the objects based on social relation data between the objects; obtaining a resource relation spectrogram between resource nodes representing the resources based on the resource relation data between the resources; and constructing an abnormal composition according to the interaction bipartite graph, the social relationship network graph and the resource relationship spectrogram.
In one embodiment, the second obtaining module is configured to determine at least one preset path type; for each sample node and each path type, screening neighbor nodes of the sample node according to the node type of the first-order neighbor node indicated by the path type to obtain at least one first-order neighbor node; for each first-order neighbor node, screening neighbor nodes of the first-order neighbor node according to the node type of the second-order neighbor node indicated by the path type to obtain at least one second-order neighbor node; and determining an original subgraph corresponding to the path type by the sample node according to the sample node, the screened first-order neighbor node, the second-order neighbor node and at least one path pointing to the first-order neighbor node from the second-order neighbor node and pointing to the sample node from the first-order neighbor node.
In one embodiment, the second obtaining module is further configured to sample the at least one first-order neighbor node to obtain a first-order sampling neighbor set; sampling the at least one second-order neighbor node to obtain a second-order sampling neighbor set; and obtaining an original subgraph of the sample node corresponding to the path type according to the sample node, a first-order neighbor node in the first-order sampling neighbor set, a second-order neighbor node in the second-order sampling neighbor set and at least one path pointing to the first-order neighbor node from the second-order neighbor node and pointing to the sample node from the first-order neighbor node.
In one embodiment, the second obtaining module is configured to perform, according to a preset graph data enhancement mode, graph data enhancement processing on the original subgraphs corresponding to the sample nodes, to obtain enhancement subgraphs corresponding to the sample nodes; the preset graph data enhancement mode is an edge discarding enhancement mode or a characteristic discarding enhancement mode.
In one embodiment, the original subgraph corresponding to the sample node includes a first-order neighbor node and a second-order neighbor node of the sample node; the graph coding module is used for acquiring node characteristics of each node in the original subgraph corresponding to the sample node; for each first-order neighbor node in the original subgraph, fusing node characteristics of second-order neighbor nodes pointing to the first-order neighbor nodes through the graph encoder to obtain fusion characteristics corresponding to the first-order neighbor nodes; for the sample node, fusing the fusion characteristics corresponding to the first-order neighbor node pointing to the sample node through the graph encoder to obtain the fusion characteristics corresponding to the sample node; and taking the fusion characteristics corresponding to the sample nodes as the original graph coding representation of the sample nodes.
In one embodiment, the graph encoding module is further configured to, when the sample node corresponds to multiple original subgraphs of different path types, aggregate, through the graph encoder, multiple fusion features of the sample node corresponding to different path types after obtaining multiple fusion features of the sample node corresponding to different path types based on the multiple original subgraphs of different path types, and obtain an aggregate feature, where the aggregate feature is used as an original graph encoding representation of the sample node.
In one embodiment, the graph encoding module is configured to determine, by the graph encoder, attention weights of the second-order neighbor nodes to the first-order neighbor nodes according to node features of the first-order neighbor nodes and node features of second-order neighbor nodes pointing to the first-order neighbor nodes, respectively; and weighting and summing node characteristics of the second-order neighbor nodes pointing to the first-order neighbor nodes according to the attention weight to obtain fusion characteristics corresponding to the first-order neighbor nodes.
In one embodiment, the graph encoding module is configured to determine, by using the graph encoder, attention weights of the first-order neighbor nodes to the sample nodes according to node features of the sample nodes and fusion features corresponding to first-order neighbor nodes pointing to the sample nodes; and carrying out weighted summation on fusion features corresponding to the first-order neighbor nodes pointing to the sample node according to the attention weight to obtain the fusion features corresponding to the sample node.
In one embodiment, the calculating module is configured to calculate, for each sample node obtained from the iso-graph, a similarity between an original graph coding representation and an enhancement graph coding representation corresponding to the sample node, to obtain an intra-sample similarity; calculating the sum of the similarity between the original graph coding representation corresponding to the sample node and the enhancement graph coding representations of other sample nodes to obtain the similarity between samples; and constructing a contrast loss of each sample node according to the intra-sample similarity and the inter-sample similarity.
In one embodiment, the computing module is configured to determine a plurality of interaction pairs according to sample nodes obtained from the heterograms, where each interaction pair includes an object sample node and a resource sample node with a connective edge; and for each interaction pair, calculating the interaction similarity of the original graph coding representation of the object sample node and the original graph coding representation of the resource sample node in the interaction pair to obtain the matching loss of each interaction pair.
In one embodiment, the training module is configured to combine the contrast loss and the matching loss to obtain a target loss; the contrast loss is determined according to intra-sample similarity between an original graph encoded representation and an enhanced graph encoded representation of the same sample node, and inter-sample similarity between the original graph encoded representation and the enhanced graph encoded representation of each of the different sample nodes, the matching loss is determined according to interaction similarity between the object sample node with the edge and the original graph encoded representation of the resource sample node, the target loss is inversely related to the intra-sample similarity, positively related to the inter-sample similarity, and inversely related to the interaction similarity; and after the network parameters of the graph encoder are updated with the aim of minimizing the target loss, returning to the step of acquiring the sample nodes from the heterograms to continue training until the training stopping condition is met, and obtaining the trained graph encoder.
In one embodiment, the model processing device for pushing resources further comprises a recall module, wherein the recall module is used for determining a target object of the resources to be pushed; determining a target object node representing the target object in the heterogeneous graph; obtaining an original subgraph corresponding to the target object node according to at least one path pointing to the target object node from the neighbor node of the target object node in the heterogram; performing graph coding on the original subgraph based on node characteristics of each node in the original subgraph through the trained graph coder to obtain an original graph coding representation of the target object node; performing graph coding on original subgraphs corresponding to resource nodes representing candidate resources in the heterogeneous graph through the trained graph coder to obtain graph coding representations of the resource nodes; and recalling the target resource from the candidate resources represented by the resource nodes according to the similarity between the graph coding representation of the target object node and the graph coding representation of each resource node.
The application also provides computer equipment. The computer device comprises a memory storing a computer program and a processor which when executing the computer program performs the steps of:
Acquiring an heterogram formed based on interaction of an object and a resource, wherein the heterogram comprises an object node and a resource node;
obtaining sample nodes from the different patterns, and for each sample node, obtaining an original subgraph corresponding to the sample node according to at least one path pointing to the sample node from a neighbor node of the sample node, and carrying out graph data enhancement on the original subgraph to obtain an enhancement subgraph corresponding to the sample node;
respectively carrying out graph coding on the original subgraph and the enhancement subgraph by utilizing a graph coder to obtain an original graph coding representation and an enhancement graph coding representation of the sample node;
calculating a contrast loss according to the similarity between the original graph coding representation and the enhancement graph coding representation of the same sample node, the similarity between the original graph coding representation and the enhancement graph coding representation of each of the different sample nodes, and calculating a matching loss according to the similarity between the object sample node with the connecting edge and the original graph coding representation of the resource sample node;
and combining the comparison loss and the matching loss for model training to obtain a trained graph encoder, wherein the trained graph encoder is used for pushing resources between objects and resources.
The application also provides a computer readable storage medium. The computer readable storage medium having stored thereon a computer program which when executed by a processor performs the steps of:
acquiring an heterogram formed based on interaction of an object and a resource, wherein the heterogram comprises an object node and a resource node;
obtaining sample nodes from the different patterns, and for each sample node, obtaining an original subgraph corresponding to the sample node according to at least one path pointing to the sample node from a neighbor node of the sample node, and carrying out graph data enhancement on the original subgraph to obtain an enhancement subgraph corresponding to the sample node;
respectively carrying out graph coding on the original subgraph and the enhancement subgraph by utilizing a graph coder to obtain an original graph coding representation and an enhancement graph coding representation of the sample node;
calculating a contrast loss according to the similarity between the original graph coding representation and the enhancement graph coding representation of the same sample node, the similarity between the original graph coding representation and the enhancement graph coding representation of each of the different sample nodes, and calculating a matching loss according to the similarity between the object sample node with the connecting edge and the original graph coding representation of the resource sample node;
And combining the comparison loss and the matching loss for model training to obtain a trained graph encoder, wherein the trained graph encoder is used for pushing resources between objects and resources.
The application also provides a computer program product. The computer program product comprises a computer program which, when executed by a processor, implements the steps of:
acquiring an heterogram formed based on interaction of an object and a resource, wherein the heterogram comprises an object node and a resource node;
obtaining sample nodes from the different patterns, and for each sample node, obtaining an original subgraph corresponding to the sample node according to at least one path pointing to the sample node from a neighbor node of the sample node, and carrying out graph data enhancement on the original subgraph to obtain an enhancement subgraph corresponding to the sample node;
respectively carrying out graph coding on the original subgraph and the enhancement subgraph by utilizing a graph coder to obtain an original graph coding representation and an enhancement graph coding representation of the sample node;
calculating a contrast loss according to the similarity between the original graph coding representation and the enhancement graph coding representation of the same sample node, the similarity between the original graph coding representation and the enhancement graph coding representation of each of the different sample nodes, and calculating a matching loss according to the similarity between the object sample node with the connecting edge and the original graph coding representation of the resource sample node;
And combining the comparison loss and the matching loss for model training to obtain a trained graph encoder, wherein the trained graph encoder is used for pushing resources between objects and resources.
The model processing method, the device, the computer equipment, the storage medium and the computer program product for pushing the resources are characterized in that the heterogeneous graph formed based on interaction of the object and the resources is obtained, and the heterogeneous graph comprises the object node and the resource node; sample nodes are obtained from the heterograms, for each sample node, an original subgraph corresponding to the sample node is obtained according to at least one path pointing to the sample node from a neighbor node of the sample node, graph data enhancement is carried out on the original subgraph, and an enhancement subgraph corresponding to the sample node is obtained, so that the difficulty of subsequent comparison learning tasks is improved, the situation that the graph encoder encodes a node representation which is fitted is effectively avoided, and the node representation is more generalized. Respectively carrying out graph coding on the original subgraph and the enhanced subgraph by utilizing a graph coder to obtain an original graph coding representation and an enhanced graph coding representation of the sample node; based on the idea of contrast learning, according to the similarity between the original image coding representation and the enhancement image coding representation of the same sample node and the similarity between the original image coding representation and the enhancement image coding representation of each of different sample nodes, calculating contrast loss so that new objects and new resources with less interaction information can be subjected to additional self-supervision learning; and according to the similarity between the object sample node with the connecting edge and the original graph coding representation of the resource sample node, calculating the matching loss, and carrying out model training by combining the comparison loss and the matching loss, learning the node representation of the new object and the new resource, and simultaneously taking account of the learning of the matching degree between the object and the resource, so as to ensure the matching degree of the object and the resource, and greatly improve the robustness of the graph encoder. Thus, the trained graph encoder not only can accurately represent the object and the resource with the interactive behavior, but also can accurately represent the new object and the new resource, thereby solving the problem of cold start pushing and being capable of improving the accuracy of the resource pushing.
Drawings
FIG. 1 is an application environment diagram of a model processing method for resource pushing in one embodiment;
FIG. 2 is a flow diagram of a model processing method for resource pushing in one embodiment;
FIG. 3 is a schematic diagram of constructing an iso-pattern in one embodiment;
FIG. 4 is a schematic diagram of an iso-pattern in one embodiment;
FIG. 5a is a schematic diagram of the original graph in one embodiment;
FIG. 5b is a schematic diagram of an original graph in another embodiment;
FIG. 6 is a schematic diagram of acquiring an aggregate feature in one embodiment;
FIG. 7 is a schematic diagram of calculation of contrast loss in one embodiment;
FIG. 8 is a flow diagram of the steps of resource recall in one embodiment;
FIG. 9 is a flowchart illustrating steps of resource recall in another embodiment;
FIG. 10 is a block diagram of a model processing device for resource pushing in one embodiment;
FIG. 11 is an internal block diagram of a computer device in one embodiment.
Detailed Description
The present application will be described in further detail with reference to the drawings and examples, in order to make the objects, technical solutions and advantages of the present application more apparent. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the application.
The embodiment of the application provides a model processing method for resource pushing, which relates to an artificial intelligence (Artificial Intelligence, AI) technology, wherein the artificial intelligence is the theory, method, technology and application system which utilizes a digital computer or a machine controlled by the digital computer to simulate, extend and expand the intelligence of people, sense the environment, acquire knowledge and acquire the best result by using the knowledge. In other words, artificial intelligence is an integrated technology of computer science that attempts to understand the essence of intelligence and to produce a new intelligent machine that can react in a similar way to human intelligence. Artificial intelligence, i.e. research on design principles and implementation methods of various intelligent machines, enables the machines to have functions of sensing, reasoning and decision.
The artificial intelligence technology is a comprehensive subject, and relates to the technology with wide fields, namely the technology with a hardware level and the technology with a software level. Artificial intelligence infrastructure technologies generally include technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technologies, operation/interaction systems, mechatronics, and the like. The artificial intelligence software technology mainly comprises a computer vision technology, a voice processing technology, a natural language processing technology, machine learning/deep learning and other directions. The embodiment of the application provides a model processing method for resource pushing, which particularly relates to a machine learning technology of an artificial intelligence technology.
In the related art, in a personalized pushing system, related users with similar hobbies or interests are found for an object according to historical behavior data of the object, and resources interacted by the related users are pushed to the object. The pushing mode is a collaborative filtering method, and the collaborative filtering method is strongly dependent on historical behavior data of the object. Therefore, for new objects and new resources where interaction information is very scarce, conventional collaborative filtering methods cannot provide accurate pushing in the case of new users and new items.
According to the model processing method for pushing the resources, provided by the embodiment of the application, the heterogeneous graph formed based on interaction of the object and the resources is obtained, and the heterogeneous graph comprises the object node and the resource node; sample nodes are obtained from the heterograms, for each sample node, an original subgraph corresponding to the sample node is obtained according to at least one path pointing to the sample node from a neighbor node of the sample node, graph data enhancement is carried out on the original subgraph, and an enhancement subgraph corresponding to the sample node is obtained, so that the difficulty of subsequent comparison learning tasks is improved, the situation that the graph encoder encodes a node representation which is fitted is effectively avoided, and the node representation is more generalized. Respectively carrying out graph coding on the original subgraph and the enhanced subgraph by utilizing a graph coder to obtain an original graph coding representation and an enhanced graph coding representation of the sample node; based on the idea of contrast learning, according to the similarity between the original image coding representation and the enhancement image coding representation of the same sample node and the similarity between the original image coding representation and the enhancement image coding representation of each of different sample nodes, calculating contrast loss so that new objects and new resources with less interaction information can be subjected to additional self-supervision learning; and according to the similarity between the object sample node with the connecting edge and the original graph coding representation of the resource sample node, calculating the matching loss, and carrying out model training by combining the comparison loss and the matching loss, learning the node representation of the new object and the new resource, and simultaneously taking account of the learning of the matching degree between the object and the resource, so as to ensure the matching degree of the object and the resource, and greatly improve the robustness of the graph encoder. Thus, the trained graph encoder not only can accurately represent the object and the resource with the interactive behavior, but also can accurately represent the new object and the new resource, thereby solving the problem of cold start pushing and being capable of improving the accuracy of the resource pushing.
The model processing method for pushing the resources, provided by the embodiment of the application, can be applied to an application environment shown in fig. 1. Wherein the terminal 102 communicates with the server 104 via a network. The data storage system may store data that the server 104 needs to process. The data storage system may be integrated on the server 104 or may be located on the cloud or other servers.
In one embodiment, the model processing method for resource pushing provided by the embodiment of the present application may be executed by the server 104. The server 104 obtains interaction data between the object and the resource from the terminal 102, and obtains a new object and a new resource, so that a heterogram formed based on interaction between the object and the resource is included in the heterogram. The server 104 obtains sample nodes from the heterograms, and for each sample node, according to at least one path pointing to the sample node from the neighbor node of the sample node, obtains an original subgraph corresponding to the sample node, and performs graph data enhancement on the original subgraph to obtain an enhanced subgraph corresponding to the sample node; the server 104 utilizes a graph encoder to respectively perform graph encoding on the original subgraph and the enhancement subgraph to obtain an original graph encoded representation and an enhancement graph encoded representation of the sample node. The server 104 calculates a contrast loss from the similarity between the original and enhanced graph encoded representations of the same sample node, the similarity between the original and enhanced graph encoded representations of the respective different sample nodes, and the matching loss from the similarity between the object sample node and the original graph encoded representation of the resource sample node where a tie exists. The server 104 performs model training by combining the contrast loss and the matching loss to obtain a trained graph encoder, wherein the trained graph encoder is used for pushing resources between objects and resources. Alternatively, the server 104 may invoke a trained graph encoder to build a push model with which to push resources to the object. For example, a client is running on the terminal 102, the server 104 may provide a resource pushing service for the client, and the server 104 performs resource pushing on the client based on object information logged in to the client. The client may be a social application client, a video client, an e-commerce client, or the like.
The terminal 102 may be, but not limited to, various personal computers, notebook computers, smart phones, tablet computers, internet of things devices, and portable wearable devices, where the internet of things devices may be smart speakers, smart televisions, smart air conditioners, smart vehicle devices, and the like. The portable wearable device may be a smart watch, smart bracelet, headset, or the like. The server 104 may be implemented as a stand-alone server or as a server cluster of multiple servers.
In one embodiment, as shown in fig. 2, a model processing method for resource pushing is provided, and the method is applied to a computer device (for example, the server 104 in fig. 1) for illustration, and includes the following steps:
step 202, obtaining an heterogram formed based on interaction of an object and a resource, wherein the heterogram comprises an object node and a resource node.
Wherein, a heterogeneous graph (which may also be understood as a heterogeneous network) refers to a graph in which node types or relationship types in the graph are more than one, and the graph refers to network structure data composed of nodes and edges.
Nodes in the heterograms comprise object nodes representing objects and resource nodes representing resources, and the heterograms can represent interaction relations or interaction information between the objects and the resources. The object is a target for pushing the resource, the resource can be any content which can be pushed to the object, such as commodities, videos, articles and the like, for example, in a multimedia pushing scene, the resource can be a popularization video, an interesting video and the like, and in an article pushing scene, the resource can be an article and the like, and the method is not particularly limited.
The edges in the heterograms refer to the connecting lines between two nodes, and represent the interaction relationship between the nodes. Alternatively, the edges in the iso-graph may have edge weights, and the weights of the edges may be the same or different. In one embodiment, there is an edge between two resource nodes that characterizes a relationship between the two resources that has similar or identical properties. Edges exist between two object nodes, and the objects are characterized by social relationships, such as attention relationships, and relationships with similar hobbies can be characterized by the objects. In a multimedia content pushing scene, edges exist between the resource nodes and the object nodes, historical interaction exists between the object which characterizes the object nodes and the resource which characterizes the resource nodes, for example, the object browses, praise, forwards, comments or collection on the resource.
Specifically, the computer device obtains an interaction bipartite graph between the object node and the resource node, and obtains an iso-graph according to the interaction bipartite graph. The interaction bipartite graph reflects interaction behaviors between an object to which the object node belongs and a resource to which the resource node belongs. For example, in a multimedia push scenario, the interaction bipartite graph reflects that an object to which an object node belongs browses, or shares, or collects, or purchases a resource to which the resource node belongs.
Alternatively, the computer device constructs the iso-composition directly from the interactive bipartite graph. Optionally, the computer device constructs the heterogram based on at least one of social relationship data between the objects and resource relationship data between the resources in combination with the interaction bipartite graph between the object nodes and the resource nodes.
In one embodiment, obtaining a heterogeneous graph formed based on interactions of objects with resources includes: based on the historical interaction data between the object and the resource, obtaining an interaction bipartite graph between the object node representing the object and the resource node representing the resource; obtaining a social relation network graph between object nodes representing the objects based on social relation data between the objects; obtaining a resource relation spectrogram between resource nodes representing the resources based on the resource relation data between the resources; and constructing an abnormal composition according to the interaction bipartite graph, the social relationship network graph and the resource relationship spectrogram.
Wherein, for the target object and the target resource, the historical interaction data between the target object and the target resource can comprise the interaction times and interaction behaviors between the target object and the target resource. The interaction may be forwarding, praise, etc. The social relationship data may include objects of interest to which each object is focused, and how frequently the object is associated with each object of interest. The resource relationship data includes resources and attributes of the resources. Optionally, the resource relationship data is obtained from a knowledge graph.
As shown in FIG. 3, each edge of the interaction bipartite graph characterizes a movie that the object has praised (i.e., liked), in FIG. 3 there is an object node u 1 To object node u 4 There is a resource node i 1 To resource node i 5 The resource to which each resource node belongs is a movie. Determining social relationships of individual object nodes, e.g., object node u, from the social relationship network diagram in FIG. 3 1 Not only with object node u 2 Has social relationship with object node u 3 Has social relationships. Determining attribute relations among all the resource nodes according to the resource relation spectrogram in FIG. 3, wherein the attribute relations of all the resource nodes are represented by auxiliary nodes, and the auxiliary node a exists 1 To auxiliary node a 4 . E.g. for resource node i 1 And resource node i 2 Belonging to the same attribute, namely auxiliary node a 1 . As shown in fig. 3, the heterograms are constructed by fusing the interaction bipartite graph, the social relationship network graph and the resource relationship spectrogram.
As shown in fig. 4, a schematic diagram of an iso-pattern in one embodiment. Referring to fig. 4, the heterogeneous graph includes object nodes u1, u2, u3, u4, u5 and resource nodes i1, i2, i3, i4, and fig. 4 is only a schematic diagram.
In this embodiment, the interaction relationship between the object node and the resource node can be reflected by the interaction bipartite graph obtained by the historical interaction data between the object and the resource and representing the interaction relationship between the object node and the resource node. Further, the social relationship network graph determined by the social relationship data between the objects reflects the social relationship between the object nodes. The resource relationship spectrogram determined by the resource relationship data among the resources reflects the attribute relationship among the resource nodes. Therefore, on the basis of determining the interaction bipartite graph between the object node and the resource node, the social relationship between the object node and the attribute relationship between the resource node and the resource node are further determined, and different semantic information can be obtained, so that the information quantity of each node in the heterogram is enriched.
Step 204, obtaining sample nodes from the heterograms, for each sample node, obtaining an original subgraph corresponding to the sample node according to at least one path pointing to the sample node from the neighbor node of the sample node, and carrying out graph data enhancement on the original subgraph to obtain an enhanced subgraph corresponding to the sample node.
The sample node may be an object node in the heterogram, or may be a resource node. In the training process of each batch, the computer equipment can sample a plurality of nodes from the heterogeneous graph to obtain a plurality of sample nodes for the batch training. For a sample node, determining corresponding neighbor nodes from the heterogeneous graph, wherein the neighbor nodes can comprise first-order neighbor nodes and second-order neighbor nodes, the first-order neighbor nodes of the sample node are nodes directly adjacent to the sample node in the heterogeneous graph, and the second-order neighbor nodes of the sample node are nodes directly adjacent to the first-order neighbor nodes of the sample node.
The path is a meta path, and in the heterogeneous graph, the path is a specific path for connecting two nodes, and can represent the composite relationship between the nodes. The paths have path types, and since the edges represent the interaction relationship between two nodes connected, the paths of different path types, i.e. obtained by alternating the nodes and edges, have semantic information. For example, a path type is object node→resource node, which may indicate that an object has a high probability of being interested in another resource that is similar to the resource that the object interacted with. For example, in a video recommendation push scenario, the path: the semantic information of 'video node → object node' is that there is a high probability that an object is interested in the video seen by another object that interacted with the object. The path type with certain semantic information can be designed according to actual requirements, and the embodiment of the application is not limited to the path type.
After determining the neighbor node of the sample node, the computer device may obtain an original subgraph corresponding to the sample node according to at least one path pointing from the neighbor node of the sample node to the sample node. The sample node may also be referred to as a center node in the original subgraph. As shown in fig. 5a, a schematic diagram of the source graph in one embodiment. In connection with fig. 4, taking the sample node as the object node u3 in fig. 4 as an example, based on the neighbor node of the object node u3, an original subgraph of the object node u3 can be obtained, as shown in fig. 5 a. In fig. 5a, a path from a neighboring node of the object node u3 to the object node u3 includes: resource node i1→object node u2→object node u3, resource node i2→object node u2→object node u3 and resource node i3→object node u1→object node u3.
In order to introduce subsequent contrast learning and avoid that the node representation obtained by subsequent learning is too much to fit sample data and new objects and new resources cannot be expressed, after the original subgraph corresponding to the sample node is obtained, the computer equipment carries out graph data enhancement processing on the original subgraph to obtain an enhancement subgraph corresponding to the sample node. In the embodiment of the application, the graph data enhancement processing is to simulate the processing mode of making the lack of interaction data between the newly added object node and the newly added resource node and the existing object node and the existing resource node, and the computer equipment can adopt the preset graph data enhancement mode, including but not limited to randomly removing a certain proportion of nodes and the connected edges thereof from the original subgraph, randomly adding or deleting a certain proportion of edges, randomly removing attribute information of part of the nodes, and the like.
Specifically, the computer device obtains each sample node by uniformly and randomly sampling each node in the heterogram. For each sample node, the computer equipment obtains an original subgraph corresponding to the sample node according to at least one path pointing to the sample node from the neighbor node of the sample node. The computer equipment determines at least one preset graph data enhancement mode corresponding to the original subgraph, and performs graph data enhancement on the original subgraph by adopting the corresponding preset graph data enhancement mode to obtain an enhanced subgraph corresponding to the sample node. The sample node serves as the center node of the original subgraph.
It should be noted that, by obtaining the sample nodes representing the objects in a uniform random sampling manner, the sampling probability of the new objects and the sampling probability of the non-new objects can be ensured to be the same, and likewise, the sample nodes representing the resources can be obtained in a uniform random sampling manner, so that the sampling probability of the new resources and the sampling probability of the non-new resources can be ensured to be the same, and the situation that the new objects and the non-new resources are not collected due to lack of interaction data between the new objects can be effectively avoided, and the effectiveness of the subsequent graph encoder training process is ensured. In one embodiment, the new object may be considered a low-lived user and the new resource may be considered a less-demanding resource. Alternatively, the new resource may be an existing resource (e.g., a long tail item) that is not in need of the new resource, or alternatively, the new resource may be a newly added resource, i.e., a newly generated resource.
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, obtaining an original subgraph corresponding to the sample node includes: determining at least one preset path type; for each sample node and each path type, screening neighbor nodes of the sample nodes according to the node type of the first-order neighbor node indicated by the path type to obtain at least one first-order neighbor node; for each first-order neighbor node, screening neighbor nodes of the first-order neighbor node according to the node type of the second-order neighbor node indicated by the path type to obtain at least one second-order neighbor node; and determining an original subgraph of a path type corresponding to the sample node according to the sample node, the screened first-order neighbor node and second-order neighbor node, and at least one path pointing to the first-order neighbor node from the second-order neighbor node and pointing to the sample node from the first-order neighbor node.
In particular, the computer device may determine a preset at least one path type that matches the push scenario. For each sample node and each path type, the computer equipment screens 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 screens 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. Therefore, the original subgraph of the path type corresponding to the sample node can be obtained according to the second-order neighbor node, the first-order neighbor node and the sample node.
For each sample node, the computer device processes in this manner to obtain the original subgraph corresponding to each sample node.
Fig. 5b is a schematic diagram of the original graph in one embodiment. Referring to fig. 5b, it is described with reference to fig. 4 that two path types are UUI and UIU, where U represents an object node, I represents a resource node, taking a sample node as an example of the object node U3 in fig. 4, for the path type UUI, the node type of the first-order neighbor node indicated by the path type is the object type, the node of the first-order neighbor node is selected from the neighbor nodes of the object node U3, and the node type of the second-order neighbor node indicated by the path type is the resource type, then, from the neighbor nodes of the first-order neighbor node object node U2 and the object node U1, the node of the second-order neighbor node is selected from the node of the resource type, and the node of the second-order neighbor node is selected from the node I1, the resource node I2 and the resource node I3, so as to obtain multiple paths, that is, and the paths form the original subgraph corresponding to the object node U3, as shown in fig. 5 b.
In this embodiment, the node types of the nodes of each order forming the path can be accurately known according to the path types and the sample nodes, so that the first-order neighbor nodes and the second-order neighbor nodes can be rapidly and accurately screened from the neighbor nodes of the sample nodes, and the original subgraphs corresponding to the path types of the sample nodes can be efficiently obtained.
In one embodiment, the method further comprises: according to the sample node, the screened first-order neighbor node and second-order neighbor node, and at least one path pointing to the first-order neighbor node from the second-order neighbor node and pointing to the sample node from the first-order neighbor node, the original subgraph of the corresponding path type of the sample node is determined, which comprises: sampling the screened first-order neighbor nodes to obtain a first-order sampling neighbor set; sampling the screened second-order neighbor nodes to obtain a second-order sampling neighbor set; and obtaining an original subgraph of a path type corresponding to the sample node according to the sample node, the first-order neighbor node in the first-order sampling neighbor set, the second-order neighbor node in the second-order sampling neighbor set and at least one path pointing to the first-order neighbor node from the second-order neighbor node and pointing to the sample node from the first-order neighbor node.
Specifically, for each sample node and each path type, after the first-order neighbor node and the second-order neighbor node of the sample node corresponding to the path type are obtained, the computer equipment performs random uniform sampling on the screened first-order neighbor nodes, or performs weight sampling according to the weights of edges between each first-order neighbor node and the sample node respectively, so as to obtain a first-order sampling neighbor set. For each first-order neighbor node in the first-order sampling neighbor set, the computer equipment 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 edges between each second-order neighbor node and the first-order neighbor node respectively, so as to obtain a second-order sampling neighbor set corresponding to the first-order neighbor node. For each sample node and each path type, the computer equipment takes the sample node as a central node, screens each second-order sampling neighbor set according to each first-order neighbor node in the first-order sampling neighbor set, and obtains at least one screened second-order sampling neighbor set. And the computer equipment obtains an original subgraph of a path type corresponding to the sample node according to the first-order neighbor node in the first-order sampling neighbor set, the second-order neighbor node in the screened second-order sampling neighbor set and at least one path pointing to the first-order neighbor node from the second-order neighbor node and pointing to the sample node from the first-order neighbor node.
In this embodiment, the first-order neighbor node before sampling is divided into two by sampling the first-order neighbor node before sampling, that is, one part is the first-order neighbor node in the first-order sampling neighbor set, and the other part is the first-order neighbor node which is not sampled. At this time, the first-order neighbor node corresponding to the second-order sampling neighbor set is an un-sampled first-order neighbor node, so in order to ensure the correctness of each path in the subsequent original subgraph, the second-order sampling neighbor set corresponding to the un-sampled first-order neighbor node needs to be deleted, so as to obtain the filtered second-order sampling neighbor set.
For example, in the case where an edge in the heterogeneous graph has an edge weight, the node may be weight-sampled in a sampling manner of the edge weight, that is, according to the weight of the edge. In the case where there is no edge weight on an edge in the heterogeneous graph, the node may be sampled by means of uniform random sampling.
In this embodiment, the number of nodes for generating the original subgraph can be further reduced by sampling the first-order neighbor nodes and the second-order neighbor nodes, so that the efficiency of performing graph coding on the sample nodes in the following process can be improved.
In one embodiment, performing graph data enhancement on an original subgraph to obtain an enhanced subgraph corresponding to a sample node, including: respectively carrying out image data enhancement processing on the original subgraphs corresponding to the sample nodes according to a preset image data enhancement mode to obtain enhanced subgraphs corresponding to the sample nodes; the preset map data enhancement mode is an edge discarding enhancement mode or a characteristic discarding enhancement mode.
The Node drop enhancement mode (Node drop) is a mode of enhancing by randomly removing a certain proportion of nodes and connected edges thereof from a graph, and the graph data enhancement mode enables the learned representation to have consistency under the disturbance of the nodes. The a priori information represented is: the missing part of nodes does not affect the semantics of the graph. Feature discard enhancements (Attribute masking) are implemented by randomly removing attribute information (which may be understood as feature information) for some nodes, causing the model to reconstruct the masked node attributes using other information.
Specifically, for each original subgraph, the computer device selects one of the edge discard enhancement mode and the feature discard enhancement mode as a preset graph data enhancement mode of the original subgraph. And the computer equipment respectively carries out image data enhancement processing on the original subgraph corresponding to the sample node according to a preset image data enhancement mode of the original subgraph to obtain an enhanced subgraph corresponding to the sample node.
Optionally, the computer equipment determines the number of sample nodes which are sampled by the training, performs graph data enhancement on the original subgraphs corresponding to one part of the sample nodes by adopting an edge discarding enhancement mode to obtain respective enhancement subgraphs, and performs graph data enhancement on the original subgraphs corresponding to the other part of the sample nodes by adopting a characteristic discarding enhancement mode to obtain respective enhancement subgraphs. For example, the number of samples participating in a batch of model training is N, the computer equipment performs edge discarding enhancement on the original subgraphs corresponding to the N/2 sample nodes respectively to obtain respective enhancement subgraphs, and performs feature discarding enhancement on the original subgraphs corresponding to the other N/2 sample nodes respectively to obtain respective enhancement subgraphs. Of course, the division manner of the sample nodes is not limited.
In this embodiment, since the interaction data between the object node representing the new object and the resource node representing the new resource is absent, the edges between the object node representing the new object and the resource node representing the new resource are sparse, that is, the interaction relationship is absent, so that the enhanced subgraph is generated by discarding the edges, it can be ensured that the extended subgraph can reflect the absence of the interaction data between the new object and the new resource. Because the new object and the new resource have lack of characteristics, the enhanced subgraph is generated by discarding the characteristics, so that the extended subgraph can be ensured to reflect the situation that the characteristic data carried by the object node representing the new object and the characteristic data carried by the resource node of the new resource are less. Therefore, by adopting the edge discarding enhancement mode for half of the original subgraphs and adopting the characteristic discarding enhancement mode for the other half of the original subgraphs, the picture encoder which is generated subsequently can be ensured to have good robustness, and the problem of low cold start pushing accuracy can be solved.
In one embodiment, for each original subgraph, the computer device selects one of an edge drop enhancement mode and a feature drop enhancement mode as a first graph data enhancement mode for the original subgraph, and after determining the first graph data enhancement mode, the method further comprises: the computer equipment combines the first image data enhancement mode with the edge disturbance enhancement mode, or combines the first image data enhancement mode with the sub-image extraction enhancement mode, or combines the first image data enhancement mode with the edge disturbance enhancement mode with the sub-image extraction enhancement mode, and carries out image data enhancement processing on the original sub-image corresponding to the sample node to obtain an enhanced sub-image corresponding to the sample node.
Wherein, the edge disturbance enhancement mode and the sub-graph extraction enhancement mode belong to the graph data enhancement mode. The edge perturbation enhancement mode (Edge perturbation) is a mode of enhancing by randomly adding or deleting a proportion of edges, which enhances the consistency of the learned representation under edge perturbation. The a priori information represented is: increasing or decreasing the partial edges does not affect the semantics of the graph. The Subgraph extraction enhancement method (Subgraph) is a method of extracting subgraphs from an original image by using a random walk method.
In this embodiment, the difficulty of the comparison learning task is improved by combining the strategies of different graph data enhancement modes, so that the phenomenon that the features learned by the subsequent graph encoder are too fit with low-level shortcuts can be avoided, and the subsequent trained graph encoder has generalization.
And 206, respectively carrying out graph coding on the original subgraph and the enhancement subgraph by utilizing a graph coder to obtain an original graph coding representation and an enhancement graph coding representation of the sample node.
Wherein the graph encoder is a graph neural network (Graph Attention Network, GAT) based on an attention mechanism for learning a low-dimensional representation for each node. Alternatively, the unencoded high-dimensional features are processed by a graph encoder to obtain a low-dimensional representation, which may be considered as a low-dimensional vector (encoding), which may characterize the features (or attributes) of the object or resource, with potential links between the elements in the low-dimensional representation.
Specifically, the computer device obtains an original graph encoded representation of the sample node from the original subgraph using a graph encoder, and obtains an enhancement graph encoded representation of the sample node from the enhancement subgraph using a graph encoder.
In one embodiment, the original subgraph corresponding to the sample node includes a first-order neighbor node and a second-order neighbor node of the sample node; the step of obtaining the original graph encoded representation of the sample node comprises: acquiring node characteristics of each node in the original subgraph corresponding to the sample node; for each first-order neighbor node in the original subgraph, fusing node characteristics of second-order neighbor nodes pointing to the first-order neighbor nodes through a graph encoder to obtain fusion characteristics corresponding to the first-order neighbor nodes; for the sample node, fusing the fusion characteristics corresponding to the first-order neighbor node pointing to the sample node through a graph encoder to obtain the fusion characteristics corresponding to the sample node; and taking the fusion characteristics corresponding to the sample nodes as the original graph coding representation of the sample nodes.
Specifically, the computer equipment acquires the node characteristics of each node in the original subgraph corresponding to the sample node. For each first-order neighbor node in the original subgraph, the computer equipment fuses node characteristics 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 fusion characteristics corresponding to the first-order neighbor node. For a sample node, the computer equipment fuses the fusion characteristics 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 fusion characteristics corresponding to the sample node. The computer equipment directly uses the fusion characteristic corresponding to the sample node as the original graph coding representation of the sample node.
For each first-order neighbor node, the attention mechanism of the graph encoder can reflect which second-order neighbor node has greater influence on the first-order neighbor node in at least one second-order neighbor node connected with the first-order neighbor node, so as to obtain more attention of the first-order neighbor node. Likewise, for a sample node in the original subgraph, by the attention mechanism of the graph encoder, it can be determined which one of the at least one first-order neighbor nodes to which the sample node is connected has more influence on the sample node, so as to obtain more attention of the sample node.
In the above embodiment, the original graph code representation of the center node of the original subgraph is accurately generated by fusing the neighbor representations (such as the fusion features of the first-order neighbor nodes or the fusion features of the sample nodes) with different importance in a hierarchical fusion manner from the second-order neighbor nodes to the first-order neighbor nodes and from the first-order neighbor nodes to the center node.
In one embodiment, the method further comprises: when the sample node corresponds to a plurality of original subgraphs with different path types, after a plurality of fusion features of the sample node corresponding to the different path types are obtained based on the plurality of original subgraphs with different path types, the plurality of fusion features of the sample node corresponding to the different path types are aggregated through a graph encoder to obtain an aggregation feature, and the aggregation feature is used as an original graph coding representation of the sample node.
Specifically, when at least two original subgraphs corresponding to at least two different path types of the sample node are obtained, after the computer equipment obtains fusion features corresponding to the original subgraphs respectively, the sample node is aggregated to a plurality of fusion features corresponding to different path types through a multi-layer perceptron (MLP, multilayer Perceptron) in the graph encoder, so that the aggregation features are obtained, and the aggregation features are used as the original graph coding representation of the sample node.
Optionally, when the sample node corresponds to at least two different path types and at least one original subgraph corresponding to each path type, after the computer equipment obtains the fusion features corresponding to each original subgraph, each fusion feature corresponding to the sample node is processed through a multi-layer perceptron of a connecting layer in the graph encoder, so as to obtain the processing features corresponding to each fusion feature. And the computer equipment obtains an aggregate characteristic according to the average value of all the processing characteristics, and takes the aggregate characteristic as an original graph coding representation of the sample node.
For each node sample, each path type corresponds to an original subgraph, and assuming that M path types exist, the computer equipment determines an aggregate characteristic h by a multi-layer perceptron of a connecting layer in the graph encoder after determining fusion characteristics corresponding to the original subgraphs respectively, and the following formula is adopted u
Wherein,and representing the fusion characteristics corresponding to the original subgraph of the mth path type corresponding to the sample node. M represents the number of original subgraphs corresponding to the sample node, also the number of path types, and MLP is a multi-layer perceptron (Multilayer Perceptron). The symbol Σ characterizes the summing operation.
Taking an example that the path type comprises IUU and UIU as shown in fig. 6, the original subgraph of the path type UUI corresponding to the sample node is shown in the left side of fig. 6, the original subgraph of the path type UIU corresponding to the sample node is shown in the right side of fig. 6, and the aggregation characteristics of the sample node are obtained by aggregating the fusion of the two original subgraphs through the full connection layer. In this embodiment, when a sample node is used for multiple original subgraphs with different path types, after multiple fusion features of the sample node corresponding to the different path types are obtained based on the multiple original subgraphs with different path types, the fusion features after different semantic information is aggregated can be obtained by aggregating each fusion feature, so that an original graph coding representation of the sample node with richer information is obtained.
In one embodiment, the enhancement subgraph corresponding to the sample node includes a first-order neighbor node and a second-order neighbor node of the sample node; the step of obtaining an enhancement map encoded representation of the sample node comprises: acquiring node characteristics of each node in the enhancement subgraph corresponding to the sample node; for each first-order neighbor node in the enhancement subgraph, fusing node characteristics of second-order neighbor nodes pointing to the first-order neighbor nodes through a graph encoder to obtain fusion characteristics corresponding to the first-order neighbor nodes; for the sample node, fusing the fusion characteristics corresponding to the first-order neighbor node pointing to the sample node through a graph encoder to obtain the fusion characteristics corresponding to the sample node; and taking the fusion characteristics corresponding to the sample nodes as enhancement map coding representation of the sample nodes.
The specific processing manner may be identical to that of the original subgraph, and the description is not repeated here.
In the above embodiment, by means of the hierarchical fusion from the second-order neighbor node to the first-order neighbor node and from the first-order neighbor node to the central node, the neighbor representations with different importance (such as the fusion features corresponding to the first-order neighbor node or the fusion features of the sample nodes) are fused, so that the enhancement graph coding representation of the sample nodes of the enhancement subgraph is accurately generated.
In one embodiment, the merging, by the graph encoder, node features of the second-order neighbor nodes pointing to the first-order neighbor nodes to obtain merging features corresponding to the first-order neighbor nodes includes: determining the attention weights of all second-order neighbor nodes to the first-order neighbor nodes respectively according to the node characteristics of the first-order neighbor nodes and the node characteristics of the second-order neighbor nodes pointing to the first-order neighbor nodes through a graph encoder; and weighting and summing node characteristics of the second-order neighbor nodes pointing to the first-order neighbor nodes according to the attention weight to obtain fusion characteristics corresponding to the first-order neighbor nodes.
Specifically, the computer device determines, through an attention mechanism in the graph encoder, attention weights of each second-order neighbor node to the first-order neighbor node according to node characteristics of the first-order neighbor node and node characteristics of second-order neighbor nodes pointing to the first-order neighbor node. The computer equipment performs weighted summation on node characteristics of second-order neighbor nodes pointing to first-order neighbor nodes according to the attention weight to obtain a weighted summation, the weighted summation reflects the merging characteristics of the second-order neighbor nodes, and the computer equipment determines the merging characteristics corresponding to the first-order neighbor nodes based on the weighted summation and the sum of the node characteristics of the first-order neighbor nodes.
For example, for a 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 The attention weight alpha of each second-order neighbor node j to the first-order neighbor node i ij The method is obtained according to the following formula I:
wherein exp (i.) represents an exponential function, the leak-corrected linear unit (leak-y-Rectified linear unit) function is an activation function, a T Transposed to a, a is the attention scoring function. W is a mapping function, also called a weight matrix, which is a model parameter that the graph encoder needs to be trained. h is a k To characterize the set N i Node characteristics of any node in the hierarchy. The attention weight alpha ij Characterizing node characteristics h i And node feature h j Is a correlation of (3).
After the attention weights of the second-order neighbor nodes corresponding to the first-order neighbor nodes are obtained, determining fusion features h 'corresponding to the first-order neighbor nodes through the following formula II' i
Where σ () represents the activation function.
In this embodiment, through the node characteristics of the first-order neighbor nodes and the node characteristics of the second-order neighbor nodes pointing to the first-order neighbor nodes, the attention weights of the second-order neighbor nodes to the first-order neighbor nodes are determined, and the fusion characteristics corresponding to the first-order neighbor nodes with different importance are fused, so that the subsequent generation of the accurate fusion characteristics of the sample nodes is facilitated.
The fusion characteristics for the sample nodes may also be determined in a similar manner as described above.
In one embodiment, fusing, by a graph encoder, fusion features corresponding to first-order neighbor nodes pointing to a sample node to obtain fusion features corresponding to the sample node, including: determining the attention weights of all first-order neighbor nodes to the sample nodes respectively according to the node characteristics of the sample nodes and the fusion characteristics corresponding to the first-order neighbor nodes pointing to the sample nodes through a graph encoder; and carrying out weighted summation on fusion features corresponding to the first-order neighbor nodes pointing to the sample nodes according to the attention weights to obtain the fusion features corresponding to the sample nodes.
Specifically, the computer device determines, through an attention mechanism in the graph encoder, attention weights of the first-order neighbor nodes to the sample nodes according to node characteristics of the sample nodes and fusion characteristics of the first-order neighbor nodes pointing to the sample nodes. The computer equipment performs weighted summation on the fusion characteristics of the first-order neighbor nodes pointing to the sample node according to the attention weight to obtain a weighted summation, the weighted summation reflects the combination characteristics of the first-order neighbor nodes, and the computer equipment determines the fusion characteristics corresponding to the sample node based on the weighted summation and the summation of the node characteristics of the sample node.
For example, the attention weights of the first-order neighbor nodes to the sample nodes can be obtained through the first formula in the foregoing embodiment. E.g., node characteristic h for sample node x x There is a fusion feature h of the first-order neighbor node y pointing to the sample node y Obtaining the attention weight of the first-order neighbor node y to the sample node x as alpha xy . Then obtaining fusion characteristics h 'corresponding to the sample node x through a formula II in the embodiment' x
In this embodiment, through node features of the sample nodes and fusion features of first-order neighbor nodes pointing to the sample nodes, attention weights of the first-order neighbor nodes to the sample nodes are determined, and through fusion, fusion features corresponding to the sample nodes with different importance can be obtained.
Step 208, calculating a contrast loss based on the similarity between the original and enhanced graph encoded representations of the same sample node, the similarity between the original and enhanced graph encoded representations of the respective different sample nodes, and calculating a matching loss based on the similarity between the object sample node and the original graph encoded representation of the resource sample node where a tie exists.
The comparison loss is the loss of the comparison learning task, and the matching loss is used for learning interest preference of the object, namely representing the matching degree between the object and the resource.
Specifically, the computer device calculates the contrast loss based on a similarity between the original and enhanced graph encoded representations of the same sample node, and a similarity between the original and enhanced graph encoded representations of respective different sample nodes of the same node type as the sample node. The computer device calculates a matching penalty based on the similarity between the object sample node for which the edge exists and the original graph-encoded representation of the resource sample node.
In one embodiment, computing the contrast loss based on a similarity between an original and an enhanced graph encoded representation of the same sample node, a similarity between an original and an enhanced graph encoded representation of each of the different sample nodes, comprises: for each sample node obtained from the heterogram, calculating the similarity between the original image coding representation and the enhancement image coding representation corresponding to the sample node to obtain the similarity in the sample; calculating the sum of the similarity between the original image coding representation corresponding to the sample node and the enhancement image coding representations of other sample nodes to obtain the similarity between samples; and constructing a contrast loss of each sample node according to the similarity in the samples and the similarity among the samples.
Specifically, for each sample node obtained from the heterogram, the computer device calculates a similarity between the original image encoded representation and the enhancement image encoded representation corresponding to the sample node, resulting in an intra-sample similarity. And the computer equipment calculates the sum of the similarity between the original graph coding representation corresponding to the sample node and the enhancement graph coding representations of other sample nodes of the same node type to obtain the similarity between samples. The computer device may construct a contrast penalty for each sample node from the ratio of intra-sample similarity to inter-sample similarity.
Optionally, after determining the contrast loss corresponding to each sample node, taking the expectation of the contrast loss corresponding to each sample node, and obtaining the contrast loss corresponding to a plurality of sample nodes.
Alternatively, the similarity may be obtained by calculating a cosine function, or may be obtained by performing an exponential operation on a value of the cosine function, which is not limited in detail.
For example, the intra-sample similarity exp (h (z g,n ,z d,n ) Inter-sample similarity) After that, the contrast loss L is obtained by the following formula NCE
z g,n And z d,n The original graph encoded representation and the enhancement graph encoded representation, respectively representing the nth sample (i.e., the nth sample node), h () represents a similarity function, where cosine similarity is used, exp () represents an exponential function, and log () is an exponential function. N' represents a sample node of a different node type from the nth sample node, and there are N total sample nodes. E [ ]For the sake of expectancy, it can be understood as the average of the contrast loss for a batch of sample nodes at the time of batch training.
In this embodiment, the robustness of the graph encoder is ensured by constructing the contrast loss with relatively large intra-sample similarity and relatively small inter-sample similarity as the optimization target so that the original graph encoded representation of the same sample node is close to the enhancement graph encoded representation, and the original graph encoded representation and the enhancement graph encoded representation principle of each of the different sample nodes.
In one embodiment, calculating a match penalty based on the similarity between the object sample nodes for which there are edges and the original graph-encoded representation of the resource sample nodes includes: determining a plurality of interaction pairs according to sample nodes obtained from the heterograms, wherein each interaction pair comprises an object sample node and a resource sample node with a connecting edge; and for each interaction pair, calculating the interaction similarity of the original graph coding representation of the object sample node and the original graph coding representation of the resource sample node in the interaction pair to obtain the matching loss of each interaction pair.
Specifically, the computer device determines a sample node having historical interaction data based on sample nodes obtained from the heterograms, and determines a plurality of interaction pairs based on the at least one sample node having historical interaction data. And for each interaction pair, calculating the interaction similarity of the original graph coding representation of the object sample node and the original graph coding representation of the resource sample node in the interaction pair to obtain the matching loss of each interaction pair.
Optionally, after determining the matching loss of each interaction pair, the computer device averages the matching losses of each interaction pair to obtain matching losses corresponding to the plurality of interaction pairs. For example, a computer device obtains 80 disparate interaction pairs. For each interaction pair, the computer device calculates a cosine value between the original graph-encoded representation of the object sample node and the original graph-encoded representation of the resource sample node in the interaction pair, and takes the cosine value as a matching penalty for the interaction pair. The cosine value characterizes the interaction similarity. The computer device calculates the average of the 80 matching losses and takes the average as the matching loss corresponding to the 80 interaction pairs.
In this embodiment, a plurality of interaction pairs are determined by the sample nodes obtained from the iso-graph. For each interaction pair, obtaining the matching loss of the interaction pair by calculating the interaction similarity of the original graph coding representation of the object sample node and the original graph coding representation of the resource sample node in the interaction pair. Therefore, through the matching loss of the interaction pair, the interest preference of the object to which the object sample node belongs in the interaction pair can be intuitively and accurately reflected, and the training of the subsequent graph encoder is facilitated.
And 210, carrying out model training by combining the contrast loss and the matching loss to obtain a trained graph encoder, wherein the trained graph encoder is used for pushing resources between objects and resources.
Specifically, the computer equipment combines the contrast loss and the matching loss, determines the target loss, and carries out iterative training on the model according to the target loss to obtain a trained graph encoder.
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 equation, the target loss L is as follows:
L=L main ({u g ,i h })+L ssl ({u k })+L ssl ({i k })
l in the above formula main ({u g ,i h }) is a match loss, where u g And i h Object sample nodes and resource sample nodes, i.e., interaction pairs, for which there are edges. L (L) ssl ({u k -u) is the contrast penalty of the object node k Characterizing object nodes, L ssl ({i k }) is the contrast penalty of a resource node, i k Characterizing a resource node. For the matching loss, if a plurality of interaction pairs exist, the computer equipment firstly determines the matching loss of each interaction pair, and then takes the average value of the matching losses of the plurality of interaction pairs as L main ({u g ,i h }). For sample nodes of each node type, if a plurality of sample nodes of the same node type exist, the computer equipment firstly determines comparison loss corresponding to each sample node respectively, and then takes the average value of the comparison loss corresponding to the sample nodes of the same node type respectively to obtain the comparison loss L of the node type ssl . The computer equipment will L main ({u g ,i h -j) the matching loss, the contrast loss of different node types are superimposed to obtainTarget loss. Wherein the contrast loss corresponding to each sample node can be the contrast loss L NCE Is calculated by the formula of (a).
In one embodiment, model training is performed by combining contrast loss and matching loss to obtain a trained graph encoder, including: the method comprises the steps of obtaining target loss by combining contrast loss and matching loss by taking the similarity between an original graph coding representation of the same sample node and an enhancement graph coding representation as large as possible, the similarity between the original graph coding representation of different sample nodes and the enhancement graph coding representation as small as possible and the similarity between the original graph coding representation of an object sample node with a connecting edge and the original graph coding representation of a resource sample node as large as an optimization target; the contrast loss is determined according to intra-sample similarity between the original image coded representation and the enhanced image coded representation of the same sample node, and inter-sample similarity between the original image coded representation and the enhanced image coded representation of each of the different sample nodes, the matching loss is determined according to interaction similarity between the object sample node with the edge and the original image coded representation of the resource sample node, and the intra-sample similarity of the target loss is in negative correlation, in positive correlation with the inter-sample similarity, and in negative correlation with the interaction similarity; and after the network parameters of the graph encoder are updated by taking the minimum target loss as a target, returning to the step of acquiring sample nodes from the heterograms, and continuing training until the training stopping condition is met, thereby obtaining the trained graph encoder.
And carrying out initial updating on network parameters of the graph encoder through target loss to obtain an initial updated graph encoder, and entering iterative training. Taking the updated graph encoder of the previous iteration as the current graph encoder of the current iteration, acquiring sample nodes of the current iteration from the heterogeneous graph, determining the current initial characteristics of the sample nodes of the current iteration, determining the target loss of the current iteration through the current graph encoder and the current initial characteristics, updating the current graph encoder to obtain the updated graph encoder if the target loss of the current iteration does not meet the training stop condition, entering the next iteration, taking the updated graph encoder as the current graph encoder corresponding to the next iteration, returning to the step of acquiring the sample nodes of the current iteration to continue to execute until the target loss of the current iteration meets the training stop condition, and obtaining the trained graph encoder; the current-time graph encoder of the first iteration is the initially updated graph encoder.
In the present embodiment, by making the similarity between the original picture encoded representation and the enhancement picture encoded representation of the same sample node large and the similarity between the original picture encoded representation and the enhancement picture encoded representation of each of the different sample nodes small, it is possible to ensure that the original picture encoded representation of the same sample node is close to the enhancement picture encoded representation and the original picture encoded representation and the enhancement picture encoded representation of each of the different sample nodes are far away. In this way, the joint training of the graph encoder is performed by using the similarity between the original graph coding representation of the same sample node and the enhancement graph coding representation as well as the similarity between the original graph coding representation and the enhancement graph coding representation of each of different sample nodes as well as the similarity between the original graph coding representation of the object sample node and the resource sample node with the edge being connected as the optimization targets, so that the trained graph encoder with more robustness can be obtained.
According to the model processing method for pushing the resources, the heterogeneous graph formed based on interaction of the objects and the resources is obtained, and the heterogeneous graph comprises the object nodes and the resource nodes; sample nodes are obtained from the heterograms, for each sample node, an original subgraph corresponding to the sample node is obtained according to at least one path pointing to the sample node from a neighbor node of the sample node, graph data enhancement is carried out on the original subgraph, and an enhancement subgraph corresponding to the sample node is obtained, so that the difficulty of subsequent comparison learning tasks is improved, the situation that the graph encoder encodes a node representation which is fitted is effectively avoided, and the node representation is more generalized. Respectively carrying out graph coding on the original subgraph and the enhanced subgraph by utilizing a graph coder to obtain an original graph coding representation and an enhanced graph coding representation of the sample node; based on the idea of contrast learning, according to the similarity between the original image coding representation and the enhancement image coding representation of the same sample node and the similarity between the original image coding representation and the enhancement image coding representation of each of different sample nodes, calculating contrast loss so that new objects and new resources with less interaction information can be subjected to additional self-supervision learning; and according to the similarity between the object sample node with the connecting edge and the original graph coding representation of the resource sample node, calculating the matching loss, and carrying out model training by combining the comparison loss and the matching loss, learning the node representation of the new object and the new resource, and simultaneously taking account of the learning of the matching degree between the object and the resource, so as to ensure the matching degree of the object and the resource, and greatly improve the robustness of the graph encoder. Thus, the trained graph encoder not only can accurately represent the object and the resource with the interactive behavior, but also can accurately represent the new object and the new resource, thereby solving the problem of cold start pushing and being capable of improving the accuracy of the resource pushing.
In one embodiment, after obtaining the original subgraphs corresponding to each sample node, the computer device performs graph data enhancement on the original subgraphs of part of the sample nodes through an edge discarding enhancement mode to obtain first enhancement subgraphs, and performs graph coding on each first enhancement subgraph through a graph coder to obtain first enhancement graph coding representations corresponding to each sample node. And for the other part of sample nodes, the computer equipment directly codes the corresponding original subgraph to obtain an original graph code representation, and then adopts a characteristic discarding enhancement mode to perform characteristic discarding processing to obtain a second enhancement graph code representation. The first enhancement map encoded representation and the second enhancement map encoded representation are both taken as enhancement map encoded representations, and then step 208 is performed.
For example, as shown in FIG. 7, a schematic diagram of the calculation of contrast loss in one embodiment. Referring to fig. 7, for different sample nodes in a batch of training (such as original subgraphs corresponding to two different sample nodes in fig. 7 respectively), different graph data enhancement modes are adopted to perform graph data enhancement. For example, an edge discarding enhancement mode is adopted for an original subgraph (such as the original subgraph 2 in fig. 7) of half sample nodes, a graph data enhancement process is performed to obtain enhancement subgraphs, and then the first enhancement subgraphs are respectively encoded by a graph encoder to obtain a first enhancement encoded representation. And (3) adopting a characteristic discarding enhancement mode to the original subgraph of the other half sample node (such as the original subgraph 1 in fig. 7), respectively encoding the original subgraphs of the half sample node through a graph encoder to obtain an original encoded representation, and then carrying out characteristic discarding on the original encoded representation to obtain a second enhancement graph encoded representation. The computer device performs a calculation of contrast loss for a batch of training based on the first enhancement coded representation of one half of the sample nodes and the second enhancement coded representation of the other half of the sample nodes in the batch of training.
In this embodiment, for each original subgraph of the feature discarding enhancement mode, the original graph coding representation of the original subgraph is determined first, and then feature discarding is directly performed on each original graph coding representation, so as to obtain the enhancement graph coding representation corresponding to the feature discarding enhancement mode. Thus, the repeated calculation of the graph encoder after the characteristic is discarded is not needed, and one graph calculation can be reduced.
FIG. 8 is a flow diagram of resource recall, in one embodiment. In one embodiment, the method further includes a step of pushing resources, and the step specifically includes:
step 802, determining a target object of a resource to be pushed.
In step 804, a target object node in the heterogeneous graph that characterizes the target object is determined.
Step 806, obtaining an original subgraph corresponding to the target object node according to at least one path pointing to the target object node from the neighbor node of the target object node in the heterogram.
And step 808, performing graph coding on the original subgraph based on the node characteristics of each node in the original subgraph through the trained graph coder to obtain the original graph coding representation of the target object node.
And 810, performing graph coding on the original subgraphs corresponding to the resource nodes representing the candidate resources in the heterogeneous graph through the trained graph encoder to obtain graph coding representations of the resource nodes.
Step 812, recalling the target resource from the candidate resources characterized by the resource nodes according to the similarity between the graph coding representation of the target object node and the graph coding representation of each resource node.
The target object may be a recorded object or a new object. The new object may be an object that already exists and has little historical interaction data (e.g., a low-activity user), or may be a newly added object. The candidate resources may be existing resources or new resources. The new resource may be a new resource or an existing resource (e.g., a long-tail article) with little demand. The aim of recalling the target resource is to rapidly screen out data with high partial matching degree from mass data for use in the subsequent sorting stage.
Specifically, after the computer device completes steps 802 through 810, for any one of the target objects, the computer device determines a target object node that characterizes the target object, and the computer device determines a similarity between the graph-encoded representation of the target object node and the graph-encoded representation of each resource node by calculating cosine values between the graph-encoded representation of the target object node and the graph-encoded representation of each resource node, respectively. The computer equipment sorts the similarity levels to obtain a similarity sequence. And the computer equipment sequentially selects a preset number of candidate resources from the highest similarity to obtain the resources to be selected. The computer equipment screens out the medium target resource from the resources to be selected.
For example, as shown in FIG. 9, a flow diagram of resource recall is shown in one embodiment. The trained graph encoder can be applied to a resource recall scene. The computer equipment determines the characteristics 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 pointing to the target object node from the neighbor node of the target object node in the heterogram. The computer equipment performs graph coding on the original subgraph based on node characteristics of each node in the original subgraph through a trained graph coder (which can be regarded as a recall model), so as to obtain an original graph coding representation (namely, the original graph coding representation can be understood as a target object characteristic representation) of the target object node. And (3) carrying out graph coding on the original subgraphs corresponding to the resource nodes representing the candidate resources in the heterogeneous graph through the trained graph coder to obtain graph coding representations (namely, the candidate resource characteristic representations) of the resource nodes. The computer equipment determines the similarity between the graph coding representation of the target object node and the graph coding representation of each resource node, and sorts the similarity. And the computer equipment sequentially selects K candidate resources from the highest similarity as candidate resources matched with the target object, namely K recall results with the highest similarity are obtained, and the K candidate resources enter a refined candidate pool.
The recall process is carried out by the trained graph encoder obtained by the method, so that the accuracy rate of cold start pushing can be improved. Taking push video scenes as an example, millions of online users are covered in a recall module of live services of social applications. In order to facilitate the display of the lifting effect of the trained graph encoder of the present application, the lifting effect is reflected by the lifting amplitude of the dimensions of the click rate of the user, the growth rate of the daily living user, etc., and the data is specifically shown in table 1:
table 1 boost amplitude analysis table
In Table 1, uctr (user-click-through-rate) is the click rate of the user, dau (day-active-users) is the daily user, and pctr (page-click-through-rate) is the click rate. Note that uctr, dau, and pctr are important indicators of whether the industry metrics are pushing accuracy. It is apparent that the trained graphic encoder of the present application enables a certain ratio of improvement to be achieved for the uctr, pctr, watch-time, dau.
In this embodiment, the trained graph encoder can obtain the high-quality original graph encoded representation of any target object and the high-quality graph encoded representation of the resource node of the candidate resource. In this way, the similarity between the graph coding representation of the target object node and the graph coding representation of each resource node can be rapidly and accurately reflected by the original graph coding representation and the graph coding representation of the resource node, so that the recall target resource of the target object is ensured to be accurately matched with the target object, and the pushing effect is improved.
The application also provides an application scene, which applies the model processing method for pushing the resources. Specifically, the application of the model processing method for resource pushing in the application scene is as follows: in a video pushing scene of a social application client, in order to accurately push video to a user, for example, live video, popularization video and the like. Specifically, a push platform server acquires an heterogram formed based on interaction of an object and a resource, wherein the heterogram comprises an object node and a resource node; obtaining sample nodes from the heterograms, for each sample node, obtaining an original subgraph corresponding to the sample node according to at least one path pointing to the sample node from a neighbor node of the sample node, and carrying out graph data enhancement on the original subgraph to obtain an enhancement subgraph corresponding to the sample node; respectively carrying out graph coding on the original subgraph and the enhanced subgraph by utilizing a graph coder to obtain an original graph coding representation and an enhanced graph coding representation of the sample node; calculating a contrast loss according to the similarity between the original graph coding representation and the enhancement graph coding representation of the same sample node, the similarity between the original graph coding representation and the enhancement graph coding representation of each of the different sample nodes, and calculating a matching loss according to the similarity between the object sample node with the connecting edge and the original graph coding representation of the resource sample node; model training is carried out by combining the contrast loss and the matching loss, so that a trained graph encoder is obtained, and the trained graph encoder is used for pushing resources between objects and resources (namely videos in the application scene).
Of course, the method for processing the model for pushing the resource is not limited to the method, and the method for processing the model for pushing the resource can be applied to other application scenes, for example, in an object pushing scene, in order to accurately push the object, a server of an e-commerce platform can realize accurate pushing of the resource (namely the object in the application scene) by the method for processing the model for pushing the resource.
The above application scenario is only illustrative, and it can be understood that the application of the model processing method for resource pushing provided by the embodiments of the present application is not limited to the above scenario.
In one particular embodiment, a model processing method for resource pushing is provided, the method being performed by a computer device.
Specifically, based on historical interaction data between the object and the resource, obtaining an interaction bipartite graph between an object node representing the object and a resource node representing the resource; obtaining a social relation network graph between object nodes representing the objects based on social relation data between the objects; obtaining a resource relation spectrogram between resource nodes representing the resources based on the resource relation data between the resources; and constructing an abnormal composition according to the interaction bipartite graph, the social relationship network graph and the resource relationship spectrogram. Acquiring sample nodes from the heterograms, and determining at least one preset path type; for each sample node and each path type, screening neighbor nodes of the sample nodes according to the node type of the first-order neighbor node indicated by the path type to obtain at least one first-order neighbor node; for each first-order neighbor node, screening neighbor nodes of the first-order neighbor node according to the node type of the second-order neighbor node indicated by the path type to obtain at least one second-order neighbor node; sampling at least one first-order neighbor node to obtain a first-order sampling neighbor set; sampling at least one second-order neighbor node to obtain a second-order sampling neighbor set; and obtaining an original subgraph of a path type corresponding to the sample node according to the sample node, the first-order neighbor node in the first-order sampling neighbor set, the second-order neighbor node in the second-order sampling neighbor set and at least one path pointing to the first-order neighbor node from the second-order neighbor node and pointing to the sample node from the first-order neighbor node. Respectively carrying out image data enhancement processing on the original subgraphs corresponding to the sample nodes according to a preset image data enhancement mode to obtain enhanced subgraphs corresponding to the sample nodes; the preset map data enhancement mode is an edge discarding enhancement mode or a characteristic discarding enhancement mode. Acquiring node characteristics of each node in the original subgraph corresponding to the sample node; for each first-order neighbor node in the original subgraph, determining the attention weight of each second-order neighbor node to the first-order neighbor node respectively according to the node characteristics of the first-order neighbor node and the node characteristics of the second-order neighbor node pointing to the first-order neighbor node through a graph encoder; and weighting and summing node characteristics of the second-order neighbor nodes pointing to the first-order neighbor nodes according to the attention weight to obtain fusion characteristics corresponding to the first-order neighbor nodes. For the sample nodes, determining the attention weights of all second-order neighbor nodes to the first-order neighbor nodes respectively according to the node characteristics of the first-order neighbor nodes and the node characteristics of the second-order neighbor nodes pointing to the first-order neighbor nodes through a graph encoder; and weighting and summing node characteristics of the second-order neighbor nodes pointing to the first-order neighbor nodes according to the attention weight to obtain fusion characteristics corresponding to the first-order neighbor nodes. When the sample node corresponds to a plurality of original subgraphs with different path types, after a plurality of fusion features of the sample node corresponding to the different path types are obtained based on the plurality of original subgraphs with different path types, the plurality of fusion features of the sample node corresponding to the different path types are aggregated through a graph encoder to obtain an aggregation feature, and the aggregation feature is used as an original graph coding representation of the sample node. Meanwhile, for the enhancement subgraph, a graph enhancement coded representation of the sample node is obtained by using a graph encoder in a similar manner to the original graph coded representation of the sample node obtained above.
For each sample node obtained from the heterogram, calculating the similarity between the original image coding representation and the enhancement image coding representation corresponding to the sample node to obtain the similarity in the sample; calculating the sum of the similarity between the original image coding representation corresponding to the sample node and the enhancement image coding representations of other sample nodes to obtain the similarity between samples; determining a plurality of interaction pairs according to sample nodes obtained from the heterograms, wherein each interaction pair comprises an object sample node and a resource sample node with a connecting edge; for each interaction pair, calculating interaction similarity of the original graph encoded representation of the object sample node and the original graph encoded representation of the resource sample node in the interaction pair; combining the intra-sample similarity, the inter-sample similarity and the interaction similarity to obtain target loss, wherein the intra-sample similarity of the target loss is in negative correlation, the intra-sample similarity of the target loss is in positive correlation, and the inter-sample similarity of the target loss is in negative correlation; and after the network parameters of the graph encoder are updated by taking the minimum target loss as a target, returning to the step of acquiring sample nodes from the heterograms, and continuing training until the training stopping condition is met, thereby obtaining the trained graph encoder.
After the trained graph encoder is obtained, determining a target object of the resource to be pushed, and determining a target object node representing the target object in the heterogeneous graph; obtaining an original subgraph corresponding to the target object node according to at least one path pointing to the target object node from the neighbor node of the target object node in the heterogram; carrying out graph coding on the original subgraph based on node characteristics of each node in the original subgraph through a trained graph coder to obtain an original graph coding representation of a target object node; carrying out graph coding on the original subgraphs corresponding to the resource nodes representing the candidate resources in the heterogeneous graph through a trained graph coder to obtain graph coding representations of all the resource nodes; and recalling the target resource from the candidate resources represented by the resource nodes according to the similarity between the graph coding representation of the target object node and the graph coding representation of each resource node.
In the embodiment, by acquiring an iso-graph formed based on interaction of an object and a resource, the iso-graph comprises an object node and a resource node; sample nodes are obtained from the heterograms, for each sample node, an original subgraph corresponding to the sample node is obtained according to at least one path pointing to the sample node from a neighbor node of the sample node, graph data enhancement is carried out on the original subgraph, and an enhancement subgraph corresponding to the sample node is obtained, so that the difficulty of subsequent comparison learning tasks is improved, the situation that the graph encoder encodes a node representation which is fitted is effectively avoided, and the node representation is more generalized. Respectively carrying out graph coding on the original subgraph and the enhanced subgraph by utilizing a graph coder to obtain an original graph coding representation and an enhanced graph coding representation of the sample node; based on the idea of contrast learning, according to the similarity between the original image coding representation and the enhancement image coding representation of the same sample node and the similarity between the original image coding representation and the enhancement image coding representation of each of different sample nodes, calculating contrast loss so that new objects and new resources with less interaction information can be subjected to additional self-supervision learning; and according to the similarity between the object sample node with the connecting edge and the original graph coding representation of the resource sample node, calculating the matching loss, and carrying out model training by combining the comparison loss and the matching loss, learning the node representation of the new object and the new resource, and simultaneously taking account of the learning of the matching degree between the object and the resource, so as to ensure the matching degree of the object and the resource, and greatly improve the robustness of the graph encoder. Thus, the trained graph encoder not only can accurately represent the object and the resource with the interactive behavior, but also can accurately represent the new object and the new resource, thereby solving the problem of cold start pushing and being capable of improving the accuracy of the resource pushing.
It should be understood that, although the steps in the flowcharts related to the embodiments described above are sequentially shown as indicated by arrows, these steps are not necessarily sequentially performed in the order indicated by the arrows. The steps are not strictly limited to the order of execution unless explicitly recited herein, and the steps may be executed in other orders. Moreover, at least some of the steps in the flowcharts described in the above embodiments may include a plurality of steps or a plurality of stages, which are not necessarily performed at the same time, but may be performed at different times, and the order of the steps or stages is not necessarily performed sequentially, but may be performed alternately or alternately with at least some of the other steps or stages.
Based on the same inventive concept, the embodiment of the application also provides a model processing device for pushing the resources, which is used for realizing the above related model processing method for pushing the resources. The implementation of the solution provided by the device is similar to the implementation described in the above method, so the specific limitation in one or more embodiments of the model processing device for resource pushing provided below may refer to the limitation of the model processing method for resource pushing hereinabove, and will not be repeated herein.
In one embodiment, as shown in fig. 10, there is provided a model processing apparatus for resource pushing, 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, wherein:
a first obtaining module 1002, configured to obtain an iso-graph formed based on interaction between an object and a resource, where the iso-graph includes an object node and a resource node;
a second obtaining module 1004, configured to obtain sample nodes from the heterograms, for each sample node, obtain an original subgraph corresponding to the sample node according to at least one path pointing to the sample node from a neighbor node of the sample node, and perform graph data enhancement on the original subgraph to obtain an enhanced subgraph corresponding to the sample node;
the graph coding module 1006 is configured to perform graph coding on the original subgraph and the enhancement subgraph by using a graph encoder, so as to obtain an original graph coding representation and an enhancement graph coding representation of the sample node;
a calculation module 1008, configured to calculate a contrast loss according to a similarity between the original image coding representation and the enhancement image coding representation of the same sample node, a similarity between the original image coding representation and the enhancement image coding representation of each of the different sample nodes, and a matching loss according to a similarity between the object sample node with a border and the original image coding representation of the resource sample node;
The training module 1010 is configured to combine the contrast loss and the matching loss to perform model training, and obtain a trained graph encoder, where the trained graph encoder is used for pushing resources between the object and the resources.
In one embodiment, a first obtaining 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; obtaining a social relation network graph between object nodes representing the objects based on social relation data between the objects; obtaining a resource relation spectrogram between resource nodes representing the resources based on the resource relation data between the resources; and constructing an abnormal composition according to the interaction bipartite graph, the social relationship network graph and the resource relationship spectrogram.
In one embodiment, the second obtaining module is configured to determine at least one preset path type; for each sample node and each path type, screening neighbor nodes of the sample nodes according to the node type of the first-order neighbor node indicated by the path type to obtain at least one first-order neighbor node; for each first-order neighbor node, screening neighbor nodes of the first-order neighbor node according to the node type of the second-order neighbor node indicated by the path type to obtain at least one second-order neighbor node; and determining an original subgraph of a path type corresponding to the sample node according to the sample node, the screened first-order neighbor node and second-order neighbor node, and at least one path pointing to the first-order neighbor node from the second-order neighbor node and pointing to the sample node from the first-order neighbor node.
In one embodiment, the second obtaining module is further configured to sample at least one first-order neighbor node to obtain a first-order sampling neighbor set; sampling at least one second-order neighbor node to obtain a second-order sampling neighbor set; and obtaining an original subgraph of a path type corresponding to the sample node according to the sample node, the first-order neighbor node in the first-order sampling neighbor set, the second-order neighbor node in the second-order sampling neighbor set and at least one path pointing to the first-order neighbor node from the second-order neighbor node and pointing to the sample node from the first-order neighbor node.
In one embodiment, the second obtaining module is configured to perform, according to a preset graph data enhancement mode, graph data enhancement processing on the original subgraphs corresponding to the sample nodes, to obtain enhancement subgraphs corresponding to the sample nodes; the preset map data enhancement mode is an edge discarding enhancement mode or a characteristic discarding enhancement mode.
In one embodiment, the original subgraph corresponding to the sample node includes a first-order neighbor node and a second-order neighbor node of the sample node; the graph coding module is used for acquiring node characteristics of each node in the original subgraph corresponding to the sample node; for each first-order neighbor node in the original subgraph, fusing node characteristics of second-order neighbor nodes pointing to the first-order neighbor nodes through a graph encoder to obtain fusion characteristics corresponding to the first-order neighbor nodes; for the sample node, fusing the fusion characteristics corresponding to the first-order neighbor node pointing to the sample node through a graph encoder to obtain the fusion characteristics corresponding to the sample node; and taking the fusion characteristics corresponding to the sample nodes as the original graph coding representation of the sample nodes.
In one embodiment, the graph encoding module is further configured to, when the sample node corresponds to the plurality of original subgraphs of different path types, aggregate, through the graph encoder, the plurality of fusion features of the sample node corresponding to the different path types after obtaining the plurality of fusion features of the sample node corresponding to the different path types based on the plurality of original subgraphs of different path types, and obtain an aggregate feature, where the aggregate feature is used as an original graph encoding representation of the sample node.
In one embodiment, the graph coding module is configured to determine, by using the graph encoder, attention weights of each second-order neighbor node to the first-order neighbor node according to node characteristics of the first-order neighbor node and node characteristics of second-order neighbor nodes pointing to the first-order neighbor node; and weighting and summing node characteristics of the second-order neighbor nodes pointing to the first-order neighbor nodes according to the attention weight to obtain fusion characteristics corresponding to the first-order neighbor nodes.
In one embodiment, the graph coding module is configured to determine, by using the graph encoder, attention weights of the first-order neighbor nodes to the sample nodes according to node features of the sample nodes and fusion features corresponding to the first-order neighbor nodes pointing to the sample nodes; and carrying out weighted summation on fusion features corresponding to the first-order neighbor nodes pointing to the sample nodes according to the attention weights to obtain the fusion features corresponding to the sample nodes.
In one embodiment, the calculating module is configured to calculate, for each sample node obtained from the iso-graph, a similarity between an original graph coding representation and an enhancement graph coding representation corresponding to the sample node, so as to obtain an intra-sample similarity; calculating the sum of the similarity between the original image coding representation corresponding to the sample node and the enhancement image coding representations of other sample nodes to obtain the similarity between samples; and constructing a contrast loss of each sample node according to the similarity in the samples and the similarity among the samples.
In one embodiment, a computing module is configured to determine a plurality of interaction pairs from sample nodes obtained from the heterograms, each interaction pair including an object sample node and a resource sample node where a join exists; and for each interaction pair, calculating the interaction similarity of the original graph coding representation of the object sample node and the original graph coding representation of the resource sample node in the interaction pair to obtain the matching loss of each interaction pair.
In one embodiment, the training module is configured to combine the contrast loss and the matching loss to obtain a target loss; the contrast loss is determined according to intra-sample similarity between an original graph encoded representation and an enhanced graph encoded representation of the same sample node, and inter-sample similarity between the original graph encoded representation and the enhanced graph encoded representation of each of the different sample nodes, the matching loss is determined according to interaction similarity between the object sample node with the edge and the original graph encoded representation of the resource sample node, the target loss is inversely related to the intra-sample similarity, positively related to the inter-sample similarity, and inversely related to the interaction similarity; and after the network parameters of the graph encoder are updated with the aim of minimizing the target loss, returning to the step of acquiring the sample nodes from the heterograms to continue training until the training stopping condition is met, and obtaining the trained graph encoder.
In one embodiment, the model processing device for pushing resources further comprises a recall module, wherein the recall module is used for determining a target object of the resources to be pushed; determining a target object node representing a target object in the heterogeneous graph; obtaining an original subgraph corresponding to the target object node according to at least one path pointing to the target object node from the neighbor node of the target object node in the heterogram; carrying out graph coding on the original subgraph based on node characteristics of each node in the original subgraph through a trained graph coder to obtain an original graph coding representation of a target object node; carrying out graph coding on the original subgraphs corresponding to the resource nodes representing the candidate resources in the heterogeneous graph through a trained graph coder to obtain graph coding representations of all the resource nodes; and recalling the target resource from the candidate resources represented by the resource nodes according to the similarity between the graph coding representation of the target object node and the graph coding representation of each resource node.
The above-mentioned respective modules in the model processing apparatus for resource pushing may be implemented in whole or in part by software, hardware, and combinations thereof. The above modules may be embedded in hardware or may be independent of a processor in the computer device, or may be stored in software in a memory in the computer device, so that the processor may call and execute operations corresponding to the above modules.
In one embodiment, a computer device is provided, which may be a server or a terminal as shown in fig. 1, and an internal structure diagram thereof may be as shown in fig. 11. The computer device includes a processor, a memory, an Input/Output interface (I/O) and a communication interface. 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. Wherein the processor of the computer device is configured 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, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The input/output interface of the computer device is used to exchange information between the processor and the external device. The communication interface of the computer device is used for communicating with an external terminal through a network connection. When the computer equipment is a terminal, the computer equipment can further comprise a display unit and an input device, wherein the display unit of the computer equipment is used for forming a visual picture, and can be a display screen, a projection device or a virtual reality imaging device, the display screen can be a liquid crystal display screen or an electronic ink display screen, the input device of the computer equipment can be a touch layer covered on the display screen, can also be a key, a track ball or a touch pad arranged on a shell of the computer equipment, and can also be an external keyboard, a touch pad or a mouse and the like. The computer program, when executed by a processor, implements a model processing method for resource pushing.
It will be appreciated by those skilled in the art that the structure shown in FIG. 11 is merely a block diagram of some of the structures associated with the present inventive arrangements and is not limiting of the computer device to which the present inventive arrangements may be applied, and that a particular computer device may include more or fewer components than shown, or may combine some of the components, or have a different arrangement of components.
In an embodiment, there is also provided a computer device comprising a memory and a processor, the memory having stored therein a computer program, the processor implementing the steps of the method embodiments described above when the computer program is executed.
In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored which, when executed by a processor, carries out the steps of the method embodiments described above.
In an embodiment, a computer program product is provided, comprising a computer program which, when executed by a processor, implements the steps of the method embodiments described above.
It should be noted that, the user information (including but not limited to user equipment information, user personal information, etc.) and the data (including but not limited to data for analysis, stored data, presented data, etc.) related to the present application are information and data authorized by the user or sufficiently authorized by each party, and the collection, use and processing of the related data need to comply with the related laws and regulations and standards of the related country and region.
Those skilled in the art will appreciate that implementing all or part of the above described methods may be accomplished by way of a computer program stored on a non-transitory computer readable storage medium, which when executed, may comprise the steps of the embodiments of the methods described above. Any reference to memory, database, or other medium used in embodiments provided herein may include at least one of non-volatile and volatile memory. The nonvolatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical Memory, high density embedded nonvolatile Memory, resistive random access Memory (ReRAM), magnetic random access Memory (Magnetoresistive Random Access Memory, MRAM), ferroelectric Memory (Ferroelectric Random Access Memory, FRAM), phase change Memory (Phase Change Memory, PCM), graphene Memory, and the like. Volatile memory can include random access memory (Random Access Memory, RAM) or external cache memory, and the like. By way of illustration, and not limitation, RAM can be in the form of a variety of forms, such as static random access memory (Static Random Access Memory, SRAM) or dynamic random access memory (Dynamic Random Access Memory, DRAM), and the like. The databases referred to in the embodiments provided herein may include at least one of a relational database and a non-relational database. The non-relational database may include, but is not limited to, a blockchain-based distributed database, and the like. The processor referred to in the embodiments provided in the present application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic unit, a data processing logic unit based on quantum computing, or the like, but is not limited thereto.
The technical features of the above embodiments may be arbitrarily combined, and all possible combinations of the technical features in the above embodiments are not described for brevity of description, however, as long as there is no contradiction between the combinations of the technical features, they should be considered as the scope of the description.
The foregoing examples illustrate only a few embodiments of the application and are described in detail herein without thereby limiting the scope of the application. It should be noted that it will be apparent to those skilled in the art that several variations and modifications can be made without departing from the spirit of the application, which are all within the scope of the application. Accordingly, the scope of the application should be assessed as that of the appended claims.

Claims (17)

1. A model processing method for resource pushing, the method comprising:
acquiring an heterogram formed based on interaction of an object and a resource, wherein the heterogram comprises an object node and a resource node;
obtaining sample nodes from the different patterns, and for each sample node, obtaining an original subgraph corresponding to the sample node according to at least one path pointing to the sample node from a neighbor node of the sample node, and carrying out graph data enhancement on the original subgraph to obtain an enhancement subgraph corresponding to the sample node;
Respectively carrying out graph coding on the original subgraph and the enhancement subgraph by utilizing a graph coder to obtain an original graph coding representation and an enhancement graph coding representation of the sample node;
calculating a contrast loss according to the similarity between the original graph coding representation and the enhancement graph coding representation of the same sample node, the similarity between the original graph coding representation and the enhancement graph coding representation of each of the different sample nodes, and calculating a matching loss according to the similarity between the object sample node with the connecting edge and the original graph coding representation of the resource sample node;
and combining the comparison loss and the matching loss for model training to obtain a trained graph encoder, wherein the trained graph encoder is used for pushing resources between objects and resources.
2. The method of claim 1, wherein the obtaining a heterogeneous graph formed based on interactions of objects with resources comprises:
based on historical interaction data between an object and a resource, obtaining an interaction bipartite graph between an object node representing the object and a resource node representing the resource;
obtaining a social relation network graph between object nodes representing the objects based on social relation data between the objects;
Obtaining a resource relation spectrogram between resource nodes representing the resources based on the resource relation data between the resources;
and constructing an abnormal composition according to the interaction bipartite graph, the social relationship network graph and the resource relationship spectrogram.
3. The method according to claim 1, wherein for each sample node, the obtaining the original subgraph corresponding to the sample node according to at least one path pointing from the neighbor node of the sample node to the sample node comprises:
determining at least one preset path type;
for each sample node and each path type, screening neighbor nodes of the sample node according to the node type of the first-order neighbor node indicated by the path type to obtain at least one first-order neighbor node;
for each first-order neighbor node, screening neighbor nodes of the first-order neighbor node according to the node type of the second-order neighbor node indicated by the path type to obtain at least one second-order neighbor node;
and determining an original subgraph corresponding to the path type by the sample node according to the sample node, the screened first-order neighbor node, the second-order neighbor node and at least one path pointing to the first-order neighbor node from the second-order neighbor node and pointing to the sample node from the first-order neighbor node.
4. A method according to claim 3, characterized in that the method further comprises:
sampling the at least one first-order neighbor node to obtain a first-order sampling neighbor set;
sampling the at least one second-order neighbor node to obtain a second-order sampling neighbor set;
the determining, according to the sample node, the screened first-order neighbor node and the second-order neighbor node, 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, an original subgraph of the sample node corresponding to the path type includes:
and obtaining an original subgraph of the sample node corresponding to the path type according to the sample node, a first-order neighbor node in the first-order sampling neighbor set, a second-order neighbor node in the second-order sampling neighbor set and at least one path pointing to the first-order neighbor node from the second-order neighbor node and pointing to the sample node from the first-order neighbor node.
5. The method according to claim 1, wherein the performing graph data enhancement on the original subgraph to obtain an enhanced subgraph corresponding to the sample node includes:
Respectively carrying out image data enhancement processing on the original subgraphs corresponding to the sample nodes according to a preset image data enhancement mode to obtain enhanced subgraphs corresponding to the sample nodes; the preset graph data enhancement mode is an edge discarding enhancement mode or a characteristic discarding enhancement mode.
6. The method of claim 1, wherein the original subgraph corresponding to the sample node includes first-order neighbor nodes and second-order neighbor nodes of the sample node; the step of obtaining the original graph encoded representation of the sample node comprises:
acquiring node characteristics of each node in the original subgraph corresponding to the sample node;
for each first-order neighbor node in the original subgraph, fusing node characteristics of second-order neighbor nodes pointing to the first-order neighbor nodes through the graph encoder to obtain fusion characteristics corresponding to the first-order neighbor nodes;
for the sample node, fusing the fusion characteristics corresponding to the first-order neighbor node pointing to the sample node through the graph encoder to obtain the fusion characteristics corresponding to the sample node;
and taking the fusion characteristics corresponding to the sample nodes as the original graph coding representation of the sample nodes.
7. The method of claim 6, wherein the method further comprises:
when the sample node corresponds to a plurality of original subgraphs with different path types, after a plurality of fusion features of the sample node corresponding to the different path types are obtained based on the plurality of original subgraphs with different path types, the plurality of fusion features of the sample node corresponding to the different path types are aggregated through the graph encoder to obtain an aggregation feature, and the aggregation feature is used as an original graph coding representation of the sample node.
8. The method according to claim 6, wherein the fusing, by the graph encoder, node features of second-order neighbor nodes pointing to the first-order neighbor nodes to obtain fused features corresponding to the first-order neighbor nodes includes:
determining, by the graph encoder, attention weights of the second-order neighbor nodes to the first-order neighbor nodes according to node characteristics of the first-order neighbor nodes and node characteristics of second-order neighbor nodes pointing to the first-order neighbor nodes;
and weighting and summing node characteristics of the second-order neighbor nodes pointing to the first-order neighbor nodes according to the attention weight to obtain fusion characteristics corresponding to the first-order neighbor nodes.
9. The method according to claim 6, wherein the fusing, by the graph encoder, the fused feature corresponding to the first-order neighbor node pointing to the sample node to obtain the fused feature corresponding to the sample node includes:
determining, by the graph encoder, attention weights of the first-order neighbor nodes to the sample nodes according to node features of the sample nodes and fusion features corresponding to the first-order neighbor nodes pointing to the sample nodes;
and carrying out weighted summation on fusion features corresponding to the first-order neighbor nodes pointing to the sample node according to the attention weight to obtain the fusion features corresponding to the sample node.
10. The method of claim 1, wherein calculating the contrast loss based on a similarity between the original and enhanced graph encoded representations of the same sample node, a similarity between the original and enhanced graph encoded representations of the different sample nodes, respectively, comprises:
for each sample node obtained from the iso-graph, calculating the similarity between the original graph coding representation and the enhancement graph coding representation corresponding to the sample node to obtain the intra-sample similarity;
Calculating the sum of the similarity between the original graph coding representation corresponding to the sample node and the enhancement graph coding representations of other sample nodes to obtain the similarity between samples;
and constructing a contrast loss of each sample node according to the intra-sample similarity and the inter-sample similarity.
11. The method of claim 1, wherein calculating the match penalty based on a similarity between the object sample node for which the edge exists and the original graph-encoded representation of the resource sample node comprises:
determining a plurality of interaction pairs according to sample nodes obtained from the heterograms, wherein each interaction pair comprises an object sample node and a resource sample node with a connecting edge;
and for each interaction pair, calculating the interaction similarity of the original graph coding representation of the object sample node and the original graph coding representation of the resource sample node in the interaction pair to obtain the matching loss of each interaction pair.
12. The method of claim 1, wherein the model training by combining the contrast loss and the matching loss results in a trained graph encoder comprising:
combining the contrast loss and the matching loss to obtain a target loss; the contrast loss is determined according to intra-sample similarity between an original graph encoded representation and an enhanced graph encoded representation of the same sample node, and inter-sample similarity between the original graph encoded representation and the enhanced graph encoded representation of each of the different sample nodes, the matching loss is determined according to interaction similarity between the object sample node with the edge and the original graph encoded representation of the resource sample node, the target loss is inversely related to the intra-sample similarity, positively related to the inter-sample similarity, and inversely related to the interaction similarity;
And after the network parameters of the graph encoder are updated with the aim of minimizing the target loss, returning to the step of acquiring the sample nodes from the heterograms to continue training until the training stopping condition is met, and obtaining the trained graph encoder.
13. The method according to any one of claims 1 to 12, further comprising:
determining a target object of a resource to be pushed;
determining a target object node representing the target object in the heterogeneous graph;
obtaining an original subgraph corresponding to the target object node according to at least one path pointing to the target object node from the neighbor node of the target object node in the heterogram;
performing graph coding on the original subgraph based on node characteristics of each node in the original subgraph through the trained graph coder to obtain an original graph coding representation of the target object node;
performing graph coding on original subgraphs corresponding to resource nodes representing candidate resources in the heterogeneous graph through the trained graph coder to obtain graph coding representations of the resource nodes;
and recalling the target resource from the candidate resources represented by the resource nodes according to the similarity between the graph coding representation of the target object node and the graph coding representation of each resource node.
14. A model processing apparatus for resource pushing, the apparatus comprising:
the first acquisition module is used for acquiring an heterogram formed based on interaction of the object and the resource, wherein the heterogram comprises an object node and a resource node;
the second acquisition module is used for acquiring sample nodes from the heterograms, and for each sample node, according to at least one path pointing to the sample node from the neighbor node of the sample node, obtaining an original subgraph corresponding to the sample node, carrying out graph data enhancement on the original subgraph, and obtaining an enhancement subgraph corresponding to the sample node;
the image coding module is used for respectively carrying out image coding on the original subgraph and the enhancement subgraph by utilizing an image coder to obtain an original image coding representation and an enhancement image coding representation of the sample node;
a calculation module, configured to calculate a contrast loss according to a similarity between an original graph coding representation and an enhanced graph coding representation of the same sample node, a similarity between an original graph coding representation and an enhanced graph coding representation of each of the different sample nodes, and calculate a matching loss according to a similarity between an object sample node with a border and an original graph coding representation of a resource sample node;
And the training module is used for carrying out model training by combining the comparison loss and the matching loss to obtain a trained graph encoder, and the trained graph encoder is used for pushing resources between objects and resources.
15. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor implements the steps of the method of any one of claims 1 to 13 when the computer program is executed.
16. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of the method of any of claims 1 to 13.
17. A computer program product comprising a computer program, characterized in that the computer program, when being executed by a processor, implements the steps of the method of any one of claims 1 to 13.
CN202211180997.4A 2022-09-27 2022-09-27 Model processing method, device, equipment and storage medium for pushing resources Pending CN117033754A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211180997.4A CN117033754A (en) 2022-09-27 2022-09-27 Model processing method, device, equipment and storage medium for pushing resources

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211180997.4A CN117033754A (en) 2022-09-27 2022-09-27 Model processing method, device, equipment and storage medium for pushing resources

Publications (1)

Publication Number Publication Date
CN117033754A true CN117033754A (en) 2023-11-10

Family

ID=88600988

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211180997.4A Pending CN117033754A (en) 2022-09-27 2022-09-27 Model processing method, device, equipment and storage medium for pushing resources

Country Status (1)

Country Link
CN (1) CN117033754A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117556149A (en) * 2024-01-11 2024-02-13 腾讯科技(深圳)有限公司 Resource pushing method, device, electronic equipment and storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117556149A (en) * 2024-01-11 2024-02-13 腾讯科技(深圳)有限公司 Resource pushing method, device, electronic equipment and storage medium
CN117556149B (en) * 2024-01-11 2024-03-26 腾讯科技(深圳)有限公司 Resource pushing method, device, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
Serafino et al. True scale-free networks hidden by finite size effects
CN109508419B (en) Knowledge learning-based recommendation method and system
CN111949886B (en) Sample data generation method and related device for information recommendation
CN113761359B (en) Data packet recommendation method, device, electronic equipment and storage medium
US20240193402A1 (en) Method and apparatus for determining representation information, device, and storage medium
CN114297509A (en) User interest vector generation method, product recommendation method, device, equipment and medium
CN114020999A (en) Community structure detection method and system for movie social network
CN115964568A (en) Personalized recommendation method based on edge cache
CN114036405A (en) Social contact recommendation method and system based on graph convolution network
CN117033754A (en) Model processing method, device, equipment and storage medium for pushing resources
US20200401880A1 (en) Generating a recommended target audience based on determining a predicted attendance utilizing a machine learning approach
Xu et al. Towards annotating media contents through social diffusion analysis
Wang et al. The silent majority speaks: Inferring silent users' opinions in online social networks
CN114756768B (en) Data processing method, device, equipment, readable storage medium and program product
CN116561443A (en) Item recommendation method and device for double-message propagation diagram based on attribute expansion
Zhang et al. Multi-view dynamic heterogeneous information network embedding
Raad et al. Foto2events: From photos to event discovery and linking in online social networks
Han et al. An effective heterogeneous information network representation learning framework
Xu et al. NC‐GNN: Consistent Neighbors of Nodes Help More in Graph Neural Networks
CN115278374B (en) Video recall method and device
CN118013060B (en) Data processing method, device, equipment, storage medium and product
Wang et al. Introduction to Big Multimodal Multimedia Data with Deep Analytics
CN116932893B (en) Sequence recommendation method, system, equipment and medium based on graph convolution network
Liu et al. Attentive-feature transfer based on mapping for cross-domain recommendation
CN117217326A (en) Model training method, apparatus, device, storage medium and computer program product

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination