Link prediction method and apparatus, model training method and apparatus, and device
By generating the content and topological features of nodes in link prediction, and utilizing graph neural networks and attention mechanisms, the problem of insufficient information in heuristic algorithms is solved, thereby improving the accuracy of link prediction and the effectiveness of information recommendation.
Patent Information
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2025-08-11
- Publication Date
- 2026-03-12
AI Technical Summary
Existing link prediction methods based on heuristic algorithms suffer from reduced accuracy due to insufficient information.
By obtaining the node embedding representations in the original target graph, content pairwise features and neighbor pairwise features are generated. Link prediction is performed using a graph neural network. By combining an attention mechanism and a multilayer perceptron module, the embedding representations of neighbor nodes are aggregated to improve prediction accuracy.
It improves the accuracy of link prediction, enabling more accurate prediction of the link relationships between nodes in the network and enhancing the effectiveness of information recommendation.
Smart Images

Figure CN2025113763_12032026_PF_FP_ABST
Abstract
Description
Link prediction method, model training method, device and equipment
[0001] The present application claims priority to the Chinese patent application No. 202411238406.3, filed on September 4, 2024, and entitled "Link prediction method, model training method, device and equipment", the whole content of which is incorporated herein by reference. TECHNICAL FIELD
[0002] The present application relates to the field of artificial intelligence, and in particular, to a link prediction method, a model training method, a device and equipment. BACKGROUND
[0003] Link prediction, that is, predicting the possibility of the existence of a link between two node representing entity objects in a network based on known network structure and other information; for example, in an information recommendation application scenario, whether there is an association relationship between two users can be predicted.
[0004] In the prior art, based on a heuristic algorithm, a heuristic scoring function is constructed by using the topological characteristic information of each node in the network to measure the similarity between nodes, and thus to reflect the possibility of the existence of a link.
[0005] However, in the above-mentioned method, only the topological characteristic information of each node is processed by using a heuristic algorithm to predict a link, which results in a low link prediction accuracy due to insufficient information. SUMMARY
[0006] The embodiments of the present application provide a link prediction method, a model training method, a device and equipment to solve the technical problem of low link prediction accuracy due to insufficient information in a heuristic algorithm.
[0007] In a first aspect, the embodiments of the present application provide a link prediction method, comprising:
[0008] obtaining a target original graph, the target original graph comprising at least one node representing an entity object, the entity object being a user; and determining an embedding representation of the node according to the target original graph; wherein the embedding representation represents the content feature of the node;
[0009] generating a content pair feature of each target node pair according to the embedding representation of each target node pair in each node; wherein the target node pair comprises two nodes of a link relationship to be predicted; and the content pair feature represents the corresponding content features between the two nodes in the target node pair;
[0010] determine at least one common neighbor node of the target node pair, and aggregate embedding representations of each of the common neighbor nodes to obtain a neighbor pair feature of the target node pair, wherein the neighbor pair feature represents a corresponding topological structure feature between two nodes in the target node pair;
[0011] generate link prediction information of the target node pair according to the content pair feature and the neighbor pair feature of the target node pair, wherein the link prediction information represents a predicted existence of a link relationship between two nodes in the target node pair.
[0012] In a possible implementation, the aggregation of the embedding representations of each of the common neighbor nodes to obtain the neighbor pair feature of the target node pair includes:
[0013] based on an attention mechanism, aggregate the embedding representations of each of the common neighbor nodes to obtain a neighbor embedding representation of the target node pair, wherein the neighbor embedding representation represents a corresponding initial topological structure feature between two nodes in the target node pair;
[0014] based on a preset multi-layer perceptron module, process the neighbor embedding representation to obtain the neighbor pair feature of the target node pair.
[0015] In a possible implementation, the aggregation of the embedding representations of each of the common neighbor nodes to obtain the neighbor embedding representation of the target node pair based on an attention mechanism includes:
[0016] determine an attention score corresponding to each of the common neighbor nodes according to the embedding representation of the common neighbor node;
[0017] based on the attention mechanism, aggregate the embedding representations of each of the common neighbor nodes according to the attention score to obtain the neighbor embedding representation of the target node pair.
[0018] In a possible implementation, the generation of the link prediction information of the target node pair according to the content pair feature and the neighbor pair feature of the target node pair includes:
[0019] splice the content pair feature and the neighbor pair feature to obtain a spliced pair feature of the target node pair;
[0020] perform a calculation on the spliced pair feature to obtain the link prediction information of the target node pair.
[0021] In a possible implementation, the determination of the embedding representation of the node according to the target original graph includes:
[0022] determine an initial representation of the node according to the target raw graph, wherein the initial representation represents an initial content feature of the node;
[0023] perform dimension reduction processing on the initial representation to obtain a dense representation of the node;
[0024] perform graph convolution processing on the target raw graph and the dense representations based on a preset graph neural network to obtain an embedding representation of each node.
[0025] In a possible implementation, the determining of the initial representation of the node according to the target raw graph comprises:
[0026] performing random walk processing on the node according to the target raw graph to obtain the initial representation of the node.
[0027] In a possible implementation, the performing of the dimension reduction processing on the initial representation to obtain the dense representation of the node comprises:
[0028] performing linear transformation processing on the initial representation to obtain a transformed initial representation;
[0029] performing batch normalization processing on the transformed initial representation to obtain a processed initial representation;
[0030] performing nonlinear activation processing on the processed initial representation to obtain the dense representation.
[0031] In a possible implementation, the preset graph neural network comprises at least one graph convolution layer, and the performing of the graph convolution processing on the target raw graph and the dense representations based on the preset graph neural network to obtain the embedding representation of each node comprises:
[0032] performing path random deactivation processing on the target raw graph to obtain a processed target raw graph;
[0033] performing graph convolution processing on the processed target raw graph and the dense representations based on the graph convolution layer to obtain a hidden representation of each node, wherein the hidden representation represents semantic data carried by the node;
[0034] performing batch normalization processing on the hidden representations to obtain a processed hidden representation of each node;
[0035] performing nonlinear activation processing on the processed hidden representations to obtain the embedding representation of each node.
[0036] In a second aspect, an embodiment of the present application provides a model training method applied to link prediction, comprising:
[0037] obtaining a to-be-trained graph, the to-be-trained graph comprising at least one to-be-trained node representing an entity object, the entity object being a to-be-trained user; and determining an embedding representation of the to-be-trained node according to the to-be-trained graph; wherein the embedding representation represents a content feature of the to-be-trained node;
[0038] generating a content pair feature of each target node pair according to the embedding representation of each target node pair in the to-be-trained nodes; wherein the target node pair comprises two to-be-trained nodes of a to-be-predicted link relationship; and the content pair feature represents a corresponding content feature between the two to-be-trained nodes in the target node pair;
[0039] determining at least one common neighbor node of the target node pair, and performing aggregation processing on the embedding representation of each common neighbor node to obtain a neighbor pair feature of the target node pair; wherein the neighbor pair feature represents a corresponding topological structure feature between the two to-be-trained nodes in the target node pair;
[0040] training an initial graph neural network according to the content pair feature and the neighbor pair feature of the target node pair to obtain a preset graph neural network; wherein the preset graph neural network is used to process the target original graph of the first aspect to generate link prediction information; and the link prediction information represents a predicted existence of a link relationship between two nodes.
[0041] In a possible implementation, the aggregation processing on the embedding representation of each common neighbor node to obtain the neighbor pair feature of the target node pair comprises:
[0042] performing aggregation processing on the embedding representation of each common neighbor node based on an attention mechanism to obtain a neighbor embedding representation of the target node pair; wherein the neighbor embedding representation represents a corresponding initial topological structure feature between the two to-be-trained nodes in the target node pair;
[0043] processing the neighbor embedding representation based on a preset multi-layer perceptron module to obtain the neighbor pair feature of the target node pair.
[0044] In a possible implementation, the aggregation processing on the embedding representation of each common neighbor node based on an attention mechanism to obtain a neighbor embedding representation of the target node pair comprises:
[0045] determining an attention score corresponding to the common neighbor node according to the embedding representation of the common neighbor node;
[0046] performing aggregation processing on the embedding representation of each common neighbor node based on the attention mechanism and according to each attention score to obtain the neighbor embedding representation of the target node pair.
[0047] In a possible implementation, the initial graph neural network is trained according to the content pair feature and the neighbor pair feature of the target node pair to obtain a preset graph neural network, including:
[0048] The link prediction information of the target node pair is generated according to the content pair feature and the neighbor pair feature of the target node pair.
[0049] The initial graph neural network is trained according to the link prediction information of the target node pair and link actual information to obtain the preset graph neural network, wherein the link actual information represents an actual link relationship between two training nodes.
[0050] In a possible implementation, the link prediction information of the target node pair is generated according to the content pair feature and the neighbor pair feature of the target node pair, including:
[0051] The content pair feature and the neighbor pair feature are spliced to obtain spliced pair features of the target node pair.
[0052] The spliced pair features are calculated to obtain the link prediction information of the target node pair.
[0053] In a possible implementation, the embedding representation of the training node is determined according to the training graph, including:
[0054] An initial representation of the training node is determined according to the training graph, wherein the initial representation represents an initial content feature of the training node.
[0055] The initial representation is dimensionally reduced to obtain a dense representation of the training node.
[0056] The training graph and the dense representation are graph-convoluted based on the initial graph neural network to obtain the embedding representation of the training node.
[0057] In a possible implementation, the initial representation of the training node is determined according to the training graph, including:
[0058] The initial representation of the training node is obtained by performing random walk processing on the training node according to the training graph.
[0059] In a possible implementation, the initial representation is dimensionally reduced to obtain the dense representation of the training node, including:
[0060] performing linear transformation processing on the initial representation to obtain a transformed initial representation;
[0061] performing batch normalization processing on the transformed initial representation to obtain a processed initial representation;
[0062] performing nonlinear activation processing on the processed initial representation to obtain an activated initial representation;
[0063] performing random deactivation processing on the activated initial representation to obtain the dense representation.
[0064] In a possible implementation, the initial graph neural network comprises at least one graph convolution layer; based on the initial graph neural network, the training graph and each dense representation are subjected to graph convolution processing to obtain an embedding representation of each training node, comprising:
[0065] performing path random deactivation processing on the training graph to obtain a processed training graph;
[0066] based on the graph convolution layer, performing graph convolution processing on the processed training graph and each dense representation to obtain an implicit representation of each training node; wherein the implicit representation represents semantic data carried by the training node;
[0067] performing batch normalization processing on each implicit representation to obtain a processed implicit representation of each training node;
[0068] performing nonlinear activation processing on each processed implicit representation to obtain an activated implicit representation of each training node;
[0069] performing random deactivation processing on each activated implicit representation to obtain an embedding representation of each training node.
[0070] In a third aspect, an embodiment of the present application provides a link prediction device, comprising:
[0071] a determination module configured to obtain a target original graph, the target original graph comprising at least one node representing an entity object, the entity object being a user; and determine an embedding representation of the node according to the target original graph; wherein the embedding representation represents the content feature of the node;
[0072] a generation module configured to generate a content pair feature of each target node pair according to the embedding representation of each target node pair in each node, wherein the target node pair comprises two nodes of a link relationship to be predicted; and the content pair feature represents the corresponding content features between the two nodes in the target node pair;
[0073] The processing module is configured to determine at least one common neighbor node of the target node pair, and aggregate the embedding representation of each common neighbor node to obtain a neighbor pair feature of the target node pair; the neighbor pair feature represents an initial topological structure feature between two nodes in the target node pair.
[0074] The prediction module is configured to generate link prediction information of the target node pair according to the content pair feature and the neighbor pair feature of the target node pair; the link prediction information represents a predicted existence of a link relationship between two nodes in the target node pair.
[0075] In a possible implementation, the processing module is specifically configured to: based on an attention mechanism, aggregate the embedding representation of each common neighbor node to obtain a neighbor embedding representation of the target node pair; the neighbor embedding representation represents the initial topological structure feature between two nodes in the target node pair; and based on a preset multi-layer perceptron module, process the neighbor embedding representation to obtain the neighbor pair feature of the target node pair.
[0076] In a possible implementation, the processing module is specifically configured to: determine an attention score corresponding to each common neighbor node according to the embedding representation of the common neighbor node; and based on the attention mechanism, aggregate the embedding representation of each common neighbor node according to the attention score to obtain the neighbor embedding representation of the target node pair.
[0077] In a possible implementation, the prediction module 604 is specifically configured to: splice the content pair feature and the neighbor pair feature to obtain a spliced pair feature of the target node pair; and perform calculation processing on the spliced pair feature to obtain the link prediction information of the target node pair.
[0078] In a possible implementation, the determination module is specifically configured to: determine an initial representation of a node according to the target original graph; the initial representation represents an initial content feature of the node; perform dimension reduction processing on the initial representation to obtain a dense representation of the node; and based on a preset graph neural network, perform graph convolution processing on the target original graph and each dense representation to obtain an embedding representation of each node.
[0079] In a possible implementation, the determination module is specifically configured to: perform random walk processing on the node according to the target original graph to obtain the initial representation of the node.
[0080] In a possible implementation, the determination module is specifically configured to: perform linear transformation processing on the initial representation to obtain a transformed initial representation; perform batch normalization processing on the transformed initial representation to obtain a processed initial representation; and perform nonlinear activation processing on the processed initial representation to obtain the dense representation.
[0081] In a possible implementation, the preset graph neural network comprises at least one graph convolution layer; the determination module is further configured to: perform path random inactivation processing on the target original graph to obtain a processed target original graph; perform graph convolution processing on the processed target original graph and the dense representations based on the graph convolution layer to obtain the hidden representations of the nodes; the hidden representations represent semantic data carried by the nodes; perform batch normalization processing on the hidden representations to obtain processed hidden representations of the nodes; and perform nonlinear activation processing on the processed hidden representations to obtain the embedding representations of the nodes.
[0082] In a fourth aspect, an embodiment of the present application provides a model training device applied to link prediction, comprising:
[0083] A determination module is configured to: acquire a to-be-trained graph, the to-be-trained graph comprising at least one to-be-trained node representing an entity object, the entity object being a to-be-trained user; and determine embedding representations of the to-be-trained nodes according to the to-be-trained graph; the embedding representations representing content features of the to-be-trained nodes.
[0084] A generation module is configured to: generate content pair features of each target node pair in the to-be-trained nodes according to the embedding representations of the target node pairs; the target node pairs comprising to-be-trained nodes of two link relationships to be predicted; the content pair features representing corresponding content features between the two to-be-trained nodes in the target node pairs.
[0085] A processing module is configured to: determine at least one common neighbor node of the target node pairs, and aggregate the embedding representations of the common neighbor nodes to obtain neighbor pair features of the target node pairs; the neighbor pair features representing corresponding topological structure features between the two to-be-trained nodes in the target node pairs.
[0086] A training module is configured to: train an initial graph neural network according to the content pair features and the neighbor pair features of the target node pairs to obtain a preset graph neural network; the preset graph neural network is used to process the target original graph of the third aspect to generate link prediction information; the link prediction information representing a predicted existence situation of a link relationship between two nodes.
[0087] In a possible implementation, the processing module is specifically configured to: perform aggregation processing on the embedding representations of the common neighbor nodes based on an attention mechanism, to obtain neighbor embedding representations of the target node pair; the neighbor embedding representations represent initial topological structure features between the two to-be-trained nodes in the target node pair; and perform processing on the neighbor embedding representations based on a preset multi-layer perceptron module, to obtain neighbor pair features of the target node pair.
[0088] In a possible implementation, the processing module is specifically configured to: determine attention scores corresponding to the common neighbor nodes according to the embedding representations of the common neighbor nodes; and perform aggregation processing on the embedding representations of the common neighbor nodes based on an attention mechanism, to obtain neighbor embedding representations of the target node pair, according to the attention scores.
[0089] In a possible implementation, the training module is specifically configured to: generate link prediction information of the target node pair according to the content pair features and the neighbor pair features of the target node pair; and perform training processing on the initial graph neural network according to the link prediction information of the target node pair and actual link information, to obtain the preset graph neural network; the actual link information represents an actual existence of a link relationship between the two to-be-trained nodes.
[0090] In a possible implementation, the training module is specifically configured to: perform splicing processing on the content pair features and the neighbor pair features, to obtain spliced pair features of the target node pair; and perform calculation processing on the spliced pair features, to obtain the link prediction information of the target node pair.
[0091] In a possible implementation, the determining module is specifically configured to: determine an initial representation of the to-be-trained node according to the to-be-trained graph; the initial representation represents an initial content feature of the to-be-trained node; perform dimension reduction processing on the initial representation, to obtain the dense representation of the to-be-trained node; and perform graph convolution processing on the to-be-trained graph and the dense representations based on the initial graph neural network, to obtain the embedding representation of each to-be-trained node.
[0092] In a possible implementation, the determining module is specifically configured to: perform random walk processing on the to-be-trained node according to the to-be-trained graph, to obtain the initial representation of the to-be-trained node.
[0093] In a possible implementation, the determining module is specifically configured to: perform linear transformation processing on the initial representation, to obtain a transformed initial representation; perform batch normalization processing on the transformed initial representation, to obtain a processed initial representation; perform nonlinear activation processing on the processed initial representation, to obtain an activated initial representation; and perform random inactivation processing on the activated initial representation, to obtain the dense representation.
[0094] In a possible implementation, the initial graph neural network comprises at least one graph convolution layer; the determination module is further configured to: perform path random deactivation processing on the to-be-trained graph to obtain a processed to-be-trained graph; perform graph convolution processing on the processed to-be-trained graph and the dense representations based on the graph convolution layer to obtain the hidden representations of the to-be-trained nodes; the hidden representations represent semantic data carried by the to-be-trained nodes; perform batch normalization processing on the hidden representations to obtain processed hidden representations of the to-be-trained nodes; perform nonlinear activation processing on the processed hidden representations to obtain activated hidden representations of the to-be-trained nodes; and perform random deactivation processing on the activated hidden representations to obtain the embedding representations of the to-be-trained nodes.
[0095] In a fifth aspect, an embodiment of the present application provides a computing device, comprising: a memory, a processor;
[0096] The memory stores computer-executable instructions.
[0097] The processor executes the computer-executable instructions stored in the memory, so that the processor executes the embodiments of the first aspect and / or the second aspect.
[0098] In a sixth aspect, an embodiment of the present application provides a computer-readable storage medium, which stores computer-executable instructions, and the computer-executable instructions are executed by a processor to implement the embodiments of the first aspect and / or the second aspect.
[0099] In a seventh aspect, an embodiment of the present application provides a computer program product, which comprises a computer program, and the computer program is executed by a processor to implement the embodiments of the first aspect and / or the second aspect.
[0100] The link prediction method, model training method, device, and apparatus provided in the embodiments of the present application can determine the content features corresponding to the nodes of each target node pair of the to-be-predicted link relationship based on the original features of the nodes of each representation entity object in the target original graph, aggregate the original features of the common neighbor nodes corresponding to each target node pair to obtain the topological structure features corresponding to the node pairs of each to-be-predicted link relationship, and then predict the existence of the link relationship between the two nodes in each target node pair according to the content features and the topological structure features of each target node pair. In this way, the local topological characteristics of the common neighbor nodes can be perceived, the original content feature information of the nodes is indirectly utilized through the node embedding representations generated by the graph neural network, the insufficient utilization of information in the existing algorithms is compensated, and the link prediction accuracy is improved. BRIEF DESCRIPTION OF DRAWINGS
[0101] The accompanying drawings, which are incorporated herein and constitute part of this specification, illustrate implementations of the application and, together with the description, further serve to explain the principles of the application.
[0102] FIG. 1 is a schematic diagram of an application scenario provided by the present application;
[0103] FIG. 2 is a schematic diagram of a link prediction method provided by an embodiment of the present application;
[0104] FIG. 3 is a schematic diagram of a common neighbor node example provided by an embodiment of the present application;
[0105] FIG. 4 is a schematic diagram of another link prediction method provided by an embodiment of the present application;
[0106] FIG. 5 is a schematic diagram of a link prediction process provided by an embodiment of the present application;
[0107] FIG. 6 is a schematic diagram of a model training method applied to link prediction provided by an embodiment of the present application;
[0108] FIG. 7 is a schematic diagram of another model training method applied to link prediction provided by an embodiment of the present application;
[0109] FIG. 8 is a schematic diagram of a multi-layer perceptron processing process provided by an embodiment of the present application;
[0110] FIG. 9 is a schematic diagram of a graph convolution network processing process provided by an embodiment of the present application;
[0111] FIG. 10 is a schematic diagram of a structure of a link prediction apparatus provided by an embodiment of the present application;
[0112] FIG. 11 is a schematic diagram of a structure of a model training apparatus applied to link prediction provided by an embodiment of the present application;
[0113] FIG. 12 is a schematic diagram of a structure of a computing device provided by an embodiment of the present application.
[0114] The specific embodiments of the present application have been shown through the above-described drawings, and will be described in more detail hereinafter. These drawings and written descriptions are not intended to limit the scope of the concept of the present application by any means, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION
[0115] The exemplary embodiments will be described in detail below with reference to the drawings. In the following description, the same numbers are used to denote the same elements throughout the several views. The implementations described in the following exemplary embodiments are not meant to represent all implementations consistent with the present disclosure. Instead, they are simply examples of apparatuses and methods consistent with some aspects of the present disclosure.
[0116] First, the terms involved in the present application are explained:
[0117] Graph Convolutional Network (GCN): a neural network that learns node representations by aggregating and transforming feature information from neighbors on a graph structure.
[0118] Message Passing Neural Network (MPNN): a graph convolutional network paradigm that aggregates neighbor information to update node representations.
[0119] Multilayer Perceptron (MLP): an artificial neural network with a feedforward structure that maps a set of input vectors to a set of output vectors.
[0120] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in the present application are all information and data authorized by the user or authorized by all parties, and the collection, use, processing, transmission, provision, disclosure and application of related data comply with relevant laws, regulations and standards, necessary security measures are taken, do not violate public order and good customs, and provide corresponding operation portal for user to choose authorization or refusal.
[0121] And the present application involves big data analysis of user information (including but not limited to personal biological characteristics, identity data, consumption data, asset data, electronic terminal operation data, etc.), and uses artificial intelligence technology for automatic decision-making, and makes technical solutions based on automatic decision-making results that have a significant impact on personal rights and interests, provides corresponding operation portal for users to choose to agree or refuse automatic decision-making results; if the user chooses to refuse, the expert decision-making process is entered.
[0122] It should be noted that the link prediction method, model training method, device and equipment of the present application can be used in the field of artificial intelligence, and can also be used in any field other than artificial intelligence. The application field of the link prediction method, model training method, device and equipment of the present application is not limited.
[0123] FIG. 1 is a schematic diagram of an application scenario provided by the present application. As shown in FIG. 1, the specific application scenario of the present application includes a computing device 101 and a plurality of user entity objects, including user A, user B, user C, user D, and user E.
[0124] In the application scenario of information recommendation, the computing device 101 obtains the nodes corresponding to user A, user B, user C, user D, and user E in the target original graph, and predicts the link relationship between two users, such as user B and user C and the link relationship between user A and user E, based on the original features of each node, such as user age, category, user portrait, and other feature data, so as to perform information recommendation.
[0125] In one example, a plurality of heuristic scoring functions are usually constructed to reflect the possibility of link existence by measuring the similarity between nodes; for example, common neighbors (CN), resource allocation (RA), and Adamic-Adar index (AA). The above-mentioned heuristic algorithms assign a preset coefficient to each common neighbor and aggregate them to obtain the final similarity score.
[0126] However, in the above-mentioned method, based on heuristic algorithms, there are artificially designed measurement rules, which are difficult to be universally applicable to various complex networks in the real world, and cannot independently adjust the operation mode according to the actual characteristics of the network, resulting in poor performance on some actual data sets. In addition, the heuristic algorithm only considers the topological structure of the network and does not incorporate the known feature information of the nodes or edges, so there is a deficiency in knowledge utilization, resulting in reduced link prediction accuracy.
[0127] In another example, a graph-based link prediction method is used. First, the structural feature generator only uses the graph adjacency matrix to construct the structural features of the nodes. Then, the algorithm calculates the node similarity score reflecting the structural features based on the overlapping neighborhood of the node pair to be predicted, uses the traditional graph neural network to give the content implicit representation of the node, and integrates the two through learnable parameters as the final link prediction result.
[0128] However, in the above-mentioned method, the known content features of the nodes are not integrated into the graph-based algorithm, and from the perspective of sufficient utilization of information, there is a certain space for improvement in algorithm performance. Moreover, when aggregating the structural features of common neighbors, each neighbor is given the same importance, which cannot adaptively adjust the size of their influence, and obviously some noise information will be involved, thereby affecting the accuracy of link prediction.
[0129] To solve the above technical problems, the present application proposes the following technical concept: the content features corresponding to the node pair of each target node pair are determined based on the original features of the node of each representative entity object in the target original graph, and the topological structure features corresponding to the node pair of each predicted link relationship are obtained by aggregating the original features of the common neighbor nodes corresponding to each target node pair, and then the existence of the link relationship between the two nodes in each target node pair can be predicted according to the content features and the topological structure features of each target node pair. In this way, the technical problem of reduced link prediction accuracy due to insufficient information in the prior art can be solved.
[0130] The technical solutions of the present application and how the technical solutions of the present application solve the above technical problems will be described in detail below with specific examples. The following specific examples can be combined with each other, and the same or similar concepts or processes can not be described again in some examples. The embodiments of the present application will be described below with reference to the accompanying drawings.
[0131] FIG. 2 is a flowchart of a link prediction method provided by an embodiment of the present application, as shown in FIG. 2, the method comprises:
[0132] 201, obtaining a target original graph, the target original graph comprising at least one node representing an entity object, the entity object being a user; and determining an embedding representation of the node based on the target original graph; wherein the embedding representation represents the content features of the node.
[0133] By way of example, the execution subject of the present embodiment can be a computing device, hereinafter referred to as a device, which can be an entity device or a virtual device that executes the link prediction method. When processing the link prediction task, the device can obtain the corresponding target original graph, which comprises at least one node representing an entity object, such as the nodes corresponding to users in a user social relationship network, or the nodes corresponding to multiple users and the nodes corresponding to goods on an e-commerce platform; the target original graph represents the link relationship between the nodes. The device processes the features of each node in the target original graph based on a pre-set feature processing algorithm to obtain the content features of the node, i.e. the embedding representation.
[0134] For example, for the target original graph, a graph convolution network based on MPNN is run on the target original graph to obtain the embedding representation of each node; for example, when the node represents a user, the content features can include the attribute features of the user such as age, address, etc., and user portrait.
[0135] 202、generate content pair features of each target node pair according to the embedding representation of each target node pair in the nodes; wherein the target node pair includes two nodes of the to-be-predicted link relationship; and the content pair features represent the corresponding content features between the two nodes in the target node pair.
[0136] For example, for each node in the obtained target original graph, each two nodes with unknown link relationship are determined as two nodes of the to-be-predicted link relationship in the target node pair. The device performs element-wise product calculation processing on the embedding representation of the two nodes in each target node pair to obtain the corresponding content features between the two nodes in each target node pair, i.e., the content pair features; for example, the user attribute feature data common to the two users.
[0137] For example, for each target node pair, link prediction is actually the prediction of the edge in the graph. Therefore, it is necessary to convert the representation of the nodes in the target node pair into the representation of the edge, and construct the pair features describing the link by performing element-wise product on the embedding representation of the two end nodes. The corresponding content features between the two users in each target node pair can be obtained by using the formula The corresponding content features between the two users in each target node pair can be obtained by using the formula (content) is an MLP, and is an element-wise product operator, is the embedding representation of user i, is the embedding representation of user j.
[0138] 203、determine at least one common neighbor node of the target node pair, and aggregate the embedding representation of each common neighbor node to obtain neighbor pair features of the target node pair; wherein the neighbor pair features represent the corresponding topological structure features between the two nodes in the target node pair.
[0139] For example, in order to obtain more information and fully perceive the local topological characteristics of each node in the target original graph, the device can determine the neighbor nodes of each node according to the distance or similarity between the two nodes. The same node in the neighbor nodes of the two nodes in each target node pair is determined as the common neighbor node of the target node pair. Based on the preset aggregation algorithm, the embedding representation of each common neighbor node of each target node pair is aggregated to obtain the neighbor pair features of the corresponding topological structure features between the two nodes in the target node pair, i.e., the neighbor pair features; for example, the network topological feature data common to the common neighbor users of the two users in the social network.
[0140] For example, FIG. 3 is a schematic diagram of an example of a common neighbor node provided by an embodiment of the present application. As shown in FIG. 3, the neighbor nodes of node 1 are The neighbor nodes of node 2 are Their common neighbor nodes are the intersection In addition, it is further emphasized that if there is no common neighbor node between two nodes, it is specified that their pair features are zero vectors, that is, 0,
[0141] 204. Generate link prediction information of the target node pair according to the content pair feature and the neighbor pair feature of the target node pair; wherein the link prediction information represents the existence of the link relationship between the two nodes in the predicted target node pair.
[0142] Exemplarily, the device processes the content pair feature and the neighbor pair feature of each target node pair based on a preset link prediction algorithm, and can obtain the existence of the link relationship between the two nodes in each predicted target node pair, that is, the link prediction information, and thus can know whether there is a link relationship between each two user nodes with unknown link relationship, which can be further applied to analyze the user social relationship network, thereby mining potential interest circles and user preferences, implementing personalized and accurate recommendation for users, and improving the click rate, retention rate and conversion rate of users.
[0143] In the embodiment, a link prediction method is provided, which aggregates the node embedding representations corresponding to the first-order common neighbor of the target node pair and obtained by the graph neural network running on the whole graph, and directly uses the node embedding representations as the pair features for describing the to-be-predicted link. Further, the local topological characteristics of the common neighbor nodes can be perceived, and the node embedding representations generated by the graph neural network indirectly utilize the original content feature information of the nodes, thereby making up for the insufficient information utilization of the existing algorithm, improving the link prediction accuracy, and further improving the accuracy of information recommendation.
[0144] FIG. 4 is a flowchart of another link prediction method provided by an embodiment of the present application. As shown in FIG. 4, the method comprises the following steps:
[0145] 301. Obtain a target original graph, wherein the target original graph comprises at least one node representing an entity object, and the entity object is a user.
[0146] Exemplarily, the present step can refer to step 201, which will not be described here again.
[0147] 302. Determine an initial representation of the node according to the target original graph; wherein the initial representation represents the initial content feature of the node.
[0148] For example, Figure 5 is a flowchart illustrating a link prediction process provided in an embodiment of this application. As shown in Figure 5, for the obtained target original graph, the target original graph may include nodes i and j corresponding to multiple users in the user's social relationship network; the device performs feature extraction processing on each node in the target original graph based on a preset feature extraction algorithm to obtain the initial content feature x of the node. i x j This refers to the initial representation. For example, when the entity object represented by this node is a user, the initial content feature can be the initial user profile of that user, such as features like student or working professional.
[0149] In one example, step 302 includes the following steps: performing random walks on the nodes based on the target original graph to obtain the initial representation of the nodes.
[0150] For example, when each node in the target original graph may not have content features, the target original graph can be an attribute graph that has node content features, or a non-attribute graph that only has topological link relationships. For an attribute graph that has node content features, the original feature x of each node i can be directly extracted. i For non-attribute graphs with only topological links, in order to solve the problem of missing original node features, the device uses position encoding based on the random walk (RW) diffusion process to construct node feature vectors and obtain the initial representation of the node.
[0151] Specifically, the eigenvector of node i can be determined by d-step random walks, using the following formula: The initial representation x of node i can be obtained. i Where RW = AD -1 Let A be the transition matrix for the random walk, where A∈{0,1} n×n Let A be an adjacency matrix. ij =1 indicates that there is an edge between node i and node j; otherwise, A ij =0; Let D be a degree matrix, where the diagonal elements are D. ii =deg(v i Let be the number of edges connected to node i, and all other elements be 0. Therefore, RW ii This represents the probability that a node i will return to itself after completing one random walk. Furthermore, by reasonably setting the step size d of the random walk, the topological characteristics around the node can be fully captured, thereby achieving the goal of making nodes distinguishable.
[0152] 303. Dimensionality reduction is performed on the initial representation to obtain a dense representation of the nodes.
[0153] Exemplarily, the device reduces dimensionality of the initial representation of each node by an MLP to obtain a dense representation of the node, since the initial representation corresponding to the feature vector is usually sparse and high-dimensional, and directly inputting the initial representation into the graph convolution layer for operation will bring great calculation pressure.
[0154] In one example, step 303 comprises the following steps:
[0155] The first step of step 303 is to perform linear transformation processing on the initial representation to obtain a transformed initial representation.
[0156] The second step of step 303 is to perform batch normalization processing on the transformed initial representation to obtain a processed initial representation.
[0157] The third step of step 303 is to perform nonlinear activation processing on the processed initial representation to obtain a dense representation.
[0158] Exemplarily, the linear transformation operation based on the MLP performs linear transformation processing on the initial representation of each node to obtain a transformed initial representation of each node; performs batch normalization processing on the transformed initial representation of each node by a preset batch normalization algorithm to obtain a processed initial representation of each node; and introduces an activation function to perform nonlinear activation processing on the processed initial representation of each node to obtain a dense representation of each node.
[0159] For example, the core of the multi-layer perceptron to realize feature transformation is linear transformation operation, that is, multiplying the feature vector by the weight parameter matrix and then adding the bias term. Formally, the process of linear transformation is: the initial representation x of each node i is linearly transformed, where is a weight parameter matrix to be learned, is a bias term to be learned, to obtain a transformed initial representation Batch normalization normalizes the input signal in each round of stochastic gradient descent in training, so that the mean of each dimension of the output signal is 0 and the variance is 1, thereby alleviating the internal covariate shift phenomenon and to some extent alleviating the gradient vanishing problem, making the training of deep networks more rapid and stable. Let the set of transformed initial representations obtained by the linear transformation layer be Then the empirical mean of and the variance are calculated as: Next, each vector in is activated by re-centering and re-scaling to obtain normalized results for each node where ε is an arbitrary small constant to ensure numerical stability, and the normalized results are with zero mean and unit variance. Finally, a scale and shift is applied to the normalized results to obtain the final transformed results of batch normalization: to obtain processed initial representations for each node where γ and δ are both learnable parameters. It is noted that the batch normalization step is optional in the multi-layer perceptron module. To introduce nonlinearity to the neurons, an activation function is applied to the processed initial representations for each node to obtain dense representations for each node after the activation function operation
[0160] 304. Based on the preset graph neural network, the target original graph and the dense representations are subjected to graph convolution processing to obtain embedding representations of the nodes.
[0161] Illustratively, the device invokes the preset graph neural network and, based on the graph neural network, subjects the target original graph and the dense representations of the nodes to graph convolution processing to obtain embedding representations of the nodes. Further, the topological structure information of the target original graph and the content feature information of the nodes can be encoded into the embedding representations of the nodes for link prediction to improve the accuracy of link prediction.
[0162] In one example, the preset graph neural network includes at least one graph convolution layer; and the step 304 includes the following steps:
[0163] The first step of the step 304 is to subject the target original graph to path random inactivation processing to obtain a processed target original graph.
[0164] The second step of the step 304 is to subject the processed target original graph and the dense representations to graph convolution processing based on the graph convolution layer to obtain hidden representations of the nodes; wherein the hidden representations represent semantic data carried by the nodes.
[0165] The third step of the step 304 is to subject the hidden representations to batch normalization processing to obtain processed hidden representations of the nodes.
[0166] The fourth step of the step 304 is to subject the processed hidden representations to non-linear activation processing to obtain embedding representations of the nodes.
[0167] Exemplarily, in combination with FIG. 5, due to various reasons, noise inevitably exists in the original graph data. For example, in a social media attention network, a user mistakenly follows a blogger who is actually not interested in. In order to improve the generalization ability of the model and make the model more robust to missing and noisy links, the original target graph is subjected to "path random deactivation" at the beginning of learning the node embedding representation, that is, some edges based on random walk sampling on the graph are deleted, and the processed target original graph is obtained. Based on the preset graph neural network, the graph neural network pre-includes a plurality of graph convolution layers. Based on each graph convolution layer, the processed target original graph and the dense representation of each node are subjected to graph convolution processing to obtain semantic data carried by each node, that is, the implicit representation. Based on the preset batch normalization algorithm, the implicit representation output by each layer of graph convolution layer is subjected to batch normalization processing to obtain the processed implicit representation of each node output by each layer of graph convolution layer. An activation function is introduced to perform nonlinear activation processing on the processed implicit representation output by each layer of graph convolution layer to obtain the embedding representation of each node output by each layer of graph convolution layer. The embedding representation of each node is obtained by stacking the results corresponding to a plurality of graph convolution layers.
[0168] For example, first, based on the lth layer of graph convolution layer, a preset calculation formula is used as follows: to obtain the implicit representation of each node, wherein, is the degree of the node with a self-loop, is a weight parameter matrix to be learned; is the dense representation obtained by using the multilayer perceptron to reduce the dimension of the original feature of the node i. The graph convolution operation is expressed in matrix form as wherein, denotes the adjacency matrix after inserting the self-loop, is the diagonal element of its degree matrix. Then, the implicit representation calculated by the graph convolution layer is sequentially sent to the subsequent batch normalization, activation function and random deactivation part to obtain the output of the lth layer of graph convolution network module It should be noted that the batch normalization and random deactivation in the graph convolution network module are optional, but are retained here for learning the node embedding representation. By stacking L such graph convolution network modules, the information of L-hop neighbors around the center node can be gathered to obtain the embedding representation of the node
[0169] 305、According to the embedding representation of each target node pair in each node, the content pair feature of each target node pair is generated; wherein the target node pair includes two nodes with a link relationship to be predicted; the content pair feature represents the corresponding content feature between the two nodes in the target node pair.
[0170] Exemplarily, the step can be referred to step 202, which will not be repeated here.
[0171] 306、determine at least one common neighbor node of the target node pair.
[0172] Exemplarily, the step can be referred to step 203, which will not be repeated here.
[0173] 307、based on the attention mechanism, aggregate the embedding representation of each common neighbor node to obtain a neighbor embedding representation of the target node pair; wherein the neighbor embedding representation represents the initial topological structure feature between the two nodes in the target node pair.
[0174] Exemplarily, in combination with FIG. 5, in order to fully perceive the local topological properties of the graph, the device calls the attention mechanism-based common neighbor-aware pair feature construction method to aggregate the embedding representation of all common neighbor nodes of each target node pair, and obtains the initial topological structure feature between the two nodes in each target node pair, i.e. the neighbor embedding representation.
[0175] For example, for the target node pair (i, j), their common neighbor-aware pair feature is defined as the aggregation of the graph convolutional network learned embedding representation of the common neighbor of the two nodes, i.e. through the formula to obtain the common neighbor embedding representation f ij wherein, denotes the adjacent node of node i, denotes the common neighbor of node i and node j, and τ is a to-be-learned parameter representing the inverse of temperature, used to control the strength of the aggregation of the Softmax function.
[0176] In one example, step 307 includes the following steps:
[0177] The first step of step 307 determines the attention score corresponding to the common neighbor node according to the embedding representation of the common neighbor node.
[0178] The second step of step 307, based on the attention mechanism, aggregates the embedding representation of each common neighbor node according to each attention score to obtain a neighbor embedding representation of the target node pair.
[0179] Exemplarily, by using the embedding representation corresponding to each of the common neighbor nodes, the attention scores of the common neighbor nodes are calculated by a Softmax function as their weights when converging, and based on the attention mechanism, the embedding representation of each of the common neighbor nodes is aggregated according to the attention scores, to adaptively generate the neighbor embedding representation of each target node pair, so as to realize the targeted neighborhood information fusion. Furthermore, not only the local topological characteristics of the first-order common neighbor can be perceived, but also the original content information of the nodes is indirectly integrated through the converged embedding representation, so as to make up for the deficiency that the content information and the topological information are separated in the prior art. This pair-wise feature generation method only needs to consider the first-order common neighbor of the target node pair, and the operation is simple and the computational complexity is low.
[0180] 308、based on the preset multi-layer perceptron module, processing the neighbor embedding representation to obtain the neighbor pair-wise feature of the target node pair.
[0181] Exemplarily, in combination with FIG. 5, the device sends the preliminary obtained neighbor embedding representation convergence result of each target node pair into a multi-layer perceptron module based on the preset multi-layer perceptron module, to calculate and process the neighbor embedding representation of each target node pair, and obtain the neighbor pair-wise feature of each target node pair; for example, by the formula to obtain the neighbor pair-wise feature wherein ψ is a multi-layer perceptron MLP. Furthermore, the node embedding representation corresponding to the first-order common neighbor of the target node pair and obtained by the graph neural network running on the whole graph is aggregated and directly used as the pair-wise feature for describing the to-be-predicted link. In this way, based on the attention mechanism, the generation of the pair-wise feature can be self-learned according to the actual situation of the common neighbor of the target node pair, and the flexibility is increased; in addition, the pair-wise feature can not only perceive the local topological characteristics of the first-order common neighbor, but also indirectly utilize the original content feature information of the node through the node embedding representation generated by the graph neural network, to make up for the insufficient information utilization of the prior art; finally, this method only needs to calculate the aggregation of the node embedding representation of the first-order common neighbor, and the operation is very simple.
[0182] 309、performing splicing processing on the content pair-wise feature and the neighbor pair-wise feature to obtain the spliced pair-wise feature of the target node pair.
[0183] Exemplarily, in combination with FIG. 5, the device performs splicing processing on the content pair-wise feature and the neighbor pair-wise feature corresponding to each target node pair to obtain the spliced pair-wise feature of each target node pair, such as
[0184] 310、performing calculation processing on the spliced pair-wise feature to obtain the link prediction information of the target node pair.
[0185] Exemplarily, in combination with FIG. 5, the device calculates the pair features of each preset link prediction algorithm, such as The spliced pair features of each target node pair are calculated and processed to obtain the link prediction information of the target node pair Wherein, ψ is a multi-layer perceptron MLP, || is a vector splicing operator, σ(·) is a Logistic function, and the prediction result Can be regarded as the likelihood of the existence of a link relationship between the node pair (i, j). Further, it can be known whether there is a link relationship between any two users whose link relationship is unknown, which can be further applied to analyze the user social relationship network, thereby mining potential interest circles and user preferences, implementing personalized and accurate recommendation for users, and improving user click rate, retention rate and conversion rate.
[0186] In the embodiment, on the basis of the above embodiment, on the one hand, the aggregation of the first-order common neighbor node embedding representation is calculated directly as the pair features describing the to-be-predicted link, which can make up for the insufficient information utilization of the existing algorithm; on the other hand, the attention mechanism is introduced, the attention scores of the embedding representations corresponding to the common neighbors are calculated, which are used as the weights when the common neighbors are converged, and the contribution degrees of the adjacent nodes to the target link prediction are large or small, some high-influence nodes are highlighted, and some potentially irrelevant noise nodes are suppressed, thereby improving the link prediction accuracy.
[0187] FIG. 6 is a flowchart of a model training method for link prediction provided by an embodiment of the present application, as shown in FIG. 6, the method comprises the following steps:
[0188] 401、Obtain a to-be-trained graph, the to-be-trained graph comprising at least one to-be-trained node representing an entity object, the entity object being a to-be-trained user; and determine an embedding representation of the to-be-trained node according to the to-be-trained graph; wherein the embedding representation represents the content features of the to-be-trained node.
[0189] Exemplarily, the execution subject of the embodiment can be a computing device, hereinafter referred to as a device, which can be an entity device or a virtual device that executes the link prediction method. When processing the link prediction task, the device can obtain a corresponding to-be-trained graph, which includes at least one to-be-trained node representing an entity object, such as a to-be-trained node corresponding to a to-be-trained user in a user social relationship network or to-be-trained nodes corresponding to to-be-trained users and to-be-trained nodes corresponding to to-be-trained commodities of an e-commerce platform; the to-be-trained graph represents the link relationship between each to-be-trained node. The device performs feature processing on each to-be-trained node in the to-be-trained graph based on a preset feature processing algorithm to obtain the content feature of the to-be-trained node, that is, the embedding representation; for example, when the entity object represented by the to-be-trained node is a to-be-trained user, the content feature can be the attribute feature of the to-be-trained user, such as age, address, and user portrait.
[0190] 402. generating a content pair feature of each target node pair based on the embedding representation of each target node pair in the to-be-trained nodes; wherein the target node pair includes two to-be-trained nodes of the to-be-predicted link relationship; the content pair feature represents the corresponding content feature between the two to-be-trained nodes in the target node pair.
[0191] Exemplarily, for each to-be-trained node in the obtained to-be-trained graph, each two to-be-trained nodes with unknown link relationship are determined as two to-be-trained nodes of the to-be-predicted link relationship in the target node pair. The device performs element-by-element multiplication calculation processing on the embedding representation of the two to-be-trained nodes in each target node pair to obtain the content feature between the two to-be-trained nodes in each target node pair, that is, the content pair feature; for example, the user attribute feature data common to the two to-be-trained users.
[0192] 403. determining at least one common neighbor node of the target node pair, and performing aggregation processing on the embedding representation of each common neighbor node to obtain a neighbor pair feature of the target node pair; wherein the neighbor pair feature represents the corresponding topological structure feature between the two to-be-trained nodes in the target node pair.
[0193] Exemplarily, in order to obtain more information and fully perceive the local topological characteristics of each to-be-trained node in the to-be-trained graph, the device can determine the neighbor nodes of each to-be-trained node according to the distance or similarity between two to-be-trained nodes, and determine the same to-be-trained nodes in the neighbor nodes of the two to-be-trained nodes in each target node pair as the common neighbor nodes of the target node pair. Based on a preset aggregation algorithm, the embedding representations of each common neighbor node of each target node pair are aggregated to obtain the neighbor pair features of the corresponding topological structure features between the two to-be-trained nodes in the target node pair, i.e., the neighbor pair features. For example, the common network topological feature data of the two users in the social network.
[0194] 404. Training the initial graph neural network based on the content pair features and the neighbor pair features of the target node pair to obtain a preset graph neural network; wherein the preset graph neural network is used to process the target original graph of the link prediction method to generate link prediction information; the link prediction information represents the existence of the predicted link relationship between two nodes.
[0195] Exemplarily, the device calls the initial graph neural network, inputs the content pair features and the neighbor pair features of each target node pair into the initial graph neural network, trains the initial graph neural network, and obtains a preset graph neural network. The preset graph neural network can be used to process the target original graph, can predict the existence of the link relationship between two nodes, i.e., the link prediction information, and can further know whether there is a link relationship between two users whose link relationship is unknown. The method can be further applied to analyze the user social relationship network, thereby mining potential interest circles and user preferences, implementing personalized and accurate recommendation for users, and improving the click rate, retention rate, and conversion rate of users.
[0196] In this embodiment, a model training method applied to link prediction is provided. The to-be-trained node embedding representations corresponding to the first-order common neighbors of the target node pair and obtained by the graph neural network running on the whole graph are aggregated and directly used as the pair features describing the to-be-predicted link. Then, the local topological characteristics of the common neighbor nodes can be perceived, and the original content feature information of the to-be-trained nodes is indirectly used through the node embedding representations generated by the graph neural network. A preset graph neural network with high prediction accuracy is generated to be used for link prediction, thereby improving the link prediction accuracy and the accuracy of information recommendation.
[0197] FIG. 7 is a flowchart of another model training method applied to link prediction provided by an embodiment of the present application. As shown in FIG. 7, the method includes the following steps:
[0198] 501、obtain a to-be-trained graph, the to-be-trained graph comprising at least one to-be-trained node representing an entity object, the entity object being a to-be-trained user.
[0199] By way of example, the present step can refer to step 401, which will not be described herein again.
[0200] 502、determine an initial representation of the to-be-trained node according to the to-be-trained graph, wherein the initial representation represents an initial content feature of the to-be-trained node.
[0201] By way of example, for the obtained to-be-trained graph, the to-be-trained graph can comprise to-be-trained nodes corresponding to a plurality of to-be-trained users in a user social relationship network; the device performs feature extraction processing on each to-be-trained node in the to-be-trained graph based on a preset feature extraction algorithm to obtain an initial content feature, i.e., an initial representation, of the to-be-trained node. For example, when the entity object represented by the to-be-trained node is a to-be-trained user, the initial content feature can be an initial user portrait of the to-be-trained user, such as a student, an office worker, and the like.
[0202] In one example, step 502 comprises the following step: performing random walk processing on the to-be-trained node according to the to-be-trained graph to obtain the initial representation of the to-be-trained node.
[0203] By way of example, when each to-be-trained node in the to-be-trained graph can not have a content feature itself, the to-be-trained graph can be an attribute graph having a node content feature itself or a non-attribute graph having only a topological link relationship. For the attribute graph having the node content feature itself, the original feature of each to-be-trained node i can be directly extracted as x i For the non-attribute graph having only the topological link relationship, in order to solve the problem of missing original features of the to-be-trained node, the device uses a position coding based on a random walk diffusion process to construct a node feature vector to obtain the initial representation of the to-be-trained node.
[0204] 503、perform dimension reduction processing on the initial representation to obtain a dense representation of the to-be-trained node.
[0205] By way of example, the device performs dimension reduction processing on the initial representation of each to-be-trained node by using an MLP, so as to obtain a dense representation of the to-be-trained node. The feature vector corresponding to the initial representation is usually relatively sparse and has a high dimension, and directly sending the initial representation into a graph convolution layer for operation will bring a large calculation pressure.
[0206] In one example, step 503 comprises the following steps:
[0207] The first step of step 503 is to perform linear transformation processing on the initial representation to obtain a transformed initial representation.
[0208] The second step of step 503 is to perform batch normalization processing on the transformed initial representation to obtain a processed initial representation.
[0209] The third step of step 503 is to perform nonlinear activation processing on the processed initial representation to obtain an activated initial representation.
[0210] The fourth step of step 503 is to perform random deactivation processing on the activated initial representation to obtain a dense representation.
[0211] Exemplarily, FIG. 8 is a flow diagram of a multi-layer perceptron processing process provided by an embodiment of the present application. As shown in FIG. 8, based on a linear transformation operation of the MLP, the initial representation of each to-be-trained node is subjected to linear transformation processing to obtain the transformed initial representation of each to-be-trained node; the transformed initial representation of each to-be-trained node is subjected to batch normalization processing through a preset batch normalization algorithm to obtain the processed initial representation of each to-be-trained node; an activation function is introduced to perform nonlinear activation processing on the processed initial representation of each to-be-trained node to obtain the activated initial representation of each to-be-trained node; and based on a preset random deactivation algorithm, the activated initial representation of each to-be-trained node is subjected to random deactivation processing to obtain the dense representation of each to-be-trained node. For example, in the model training stage, the calculation formula of random deactivation is as follows: the activated initial representation of each to-be-trained node calculation, to obtain the dense representation of each to-be-trained node wherein m represents a mask vector, each element of which is a random variable following a Bernoulli distribution with a probability p, and the symbol represents Hadamard product, that is, element-wise multiplication.
[0212] 504. Based on the initial graph neural network, the to-be-trained graph and the dense representations are subjected to graph convolution processing to obtain the embedding representation of each to-be-trained node.
[0213] Exemplarily, the device calls the initial graph neural network, and based on the graph neural network, the to-be-trained graph and the dense representations of each to-be-trained node are subjected to graph convolution processing to obtain the embedding representation of each to-be-trained node. Further, the topological structure information of the to-be-trained graph and the content feature information of the to-be-trained node can be encoded into the embedding representation of the to-be-trained node, which is used for model training and link prediction application of the model to improve the prediction accuracy of link prediction.
[0214] In one example, the initial graph neural network includes at least one graph convolution layer; and step 304 includes the following steps:
[0215] The first step of step 504 is to perform path random deactivation processing on the to-be-trained graph to obtain a processed to-be-trained graph.
[0216] The second step of step 504 is to perform graph convolution processing on the processed training graph and the dense representation of each node based on the graph convolution layer to obtain the hidden representation of each training node, wherein the hidden representation represents the semantic data carried by the training node.
[0217] The third step of step 504 is to perform batch normalization processing on the hidden representation to obtain the processed hidden representation of each training node.
[0218] The fourth step of step 504 is to perform nonlinear activation processing on the processed hidden representation to obtain the activated hidden representation of each training node.
[0219] The fifth step of step 504 is to perform random deactivation processing on the activated hidden representation to obtain the embedding representation of each training node.
[0220] For example, FIG. 9 is a flowchart of a graph convolution network processing process provided by an embodiment of the present application. As shown in FIG. 9, in order to improve the generalization ability of the model and make the model more robust to missing and noisy links, the training graph needs to be subjected to “path random deactivation” at the beginning of learning the node embedding representation, so as to obtain the processed training graph. Based on the initial graph neural network, the graph neural network includes a plurality of graph convolution layers in advance. Based on each graph convolution layer, the processed training graph and the dense representation of each training node are subjected to graph convolution processing to obtain the semantic data carried by each training node, i.e., the hidden representation. Based on a preset batch normalization algorithm, the hidden representation output by each layer of graph convolution layer is subjected to batch normalization processing to obtain the processed hidden representation of each training node output by each layer of graph convolution layer. An activation function is introduced to perform nonlinear activation processing on the processed hidden representation output by each layer of graph convolution layer to obtain the activated hidden representation of each training node output by each layer of graph convolution layer. Based on a random deactivation algorithm, the activated hidden representation of each training node is subjected to random deactivation processing, and the embedding representation of each training node is obtained by stacking the results of a plurality of graph convolution layers.
[0221] 505. Generating content pair features of each target node pair according to the embedding representation of each target node pair in the training nodes, wherein the target node pair includes two training nodes of the predicted link relationship, and the content pair features represent the corresponding content features between the two training nodes in the target node pair.
[0222] For example, this step can refer to step 402, which will not be described here.
[0223] 506. Determining at least one common neighbor node of the target node pair.
[0224] Exemplarily, the step can be referred to step 403, which will not be repeated here.
[0225] 507. Based on the attention mechanism, the embedding representations of the common neighbor nodes are aggregated to obtain neighbor embedding representations of the target node pair; wherein the neighbor embedding representations represent the initial topological structure features between the two training nodes in the target node pair.
[0226] Exemplarily, in order to fully perceive the local topological properties of the training graph, the device calls the attention mechanism-based common neighbor-aware pair feature construction method to aggregate the embedding representations of all common neighbor nodes of each target node pair, and obtains the initial topological structure features between the two training nodes in each target node pair, i.e. neighbor embedding representations.
[0227] In one example, step 507 includes the following steps:
[0228] The first step of step 507 determines the attention score corresponding to the common neighbor node according to the embedding representation of the common neighbor node.
[0229] The second step of step 507 aggregates the embedding representations of the common neighbor nodes based on the attention mechanism according to the attention scores to obtain the neighbor embedding representations of the target node pair.
[0230] Exemplarily, the embedding representations of the common neighbor nodes are used to calculate the attention scores of the common neighbor nodes by the Softmax function as their weights when converging. Based on the attention mechanism, the embedding representations of the common neighbor nodes are aggregated according to the attention scores to adaptively generate the neighbor embedding representations of each target node pair, and the targeted neighborhood information fusion is achieved. Furthermore, not only the first-order common neighbor, i.e. the local topological property, can be perceived, but also the original content information of the nodes is indirectly integrated through the aggregation of the embedding representations, thereby making up for the deficiency that the content information and the topological information are separated in the prior art. This pair feature generation method only needs to consider the first-order common neighbor of the target node pair, and the operation is simple and the computational complexity is low.
[0231] 508. Based on the preset multi-layer perceptron module, the neighbor embedding representations are processed to obtain neighbor pair features of the target node pair.
[0232] Exemplarily, the device feeds the converged result of the preliminary obtained neighbor embedding representation of each target node pair into a preset multi-layer perceptron module based on the multi-layer perceptron module, and obtains neighbor pair features of each target node pair by calculating and processing the neighbor embedding representation of each target node pair. Furthermore, the node embedding representation corresponding to the first-order common neighbor of the target node pair and obtained by the graph neural network running on the whole graph is aggregated and directly used as the pair feature for describing the to-be-predicted link. In this way, based on the attention mechanism, the generation of the pair feature can be autonomously learned according to the actual situation of the common neighbor of the target node pair, and the flexibility is increased. In addition, the pair feature not only perceives the local topological characteristics of the first-order common neighbor, but also indirectly utilizes the original content feature information of the node through the node embedding representation generated by the graph neural network, thereby making up for the insufficient information utilization of the existing algorithm. Finally, the aggregation of the node embedding representation of the first-order common neighbor only needs to be calculated, and the operation is very simple.
[0233] 509. Generating link prediction information of the target node pair based on the content pair feature and the neighbor pair feature of the target node pair.
[0234] Exemplarily, the device processes the content pair feature and the neighbor pair feature of each target node pair based on a preset link prediction algorithm, and can obtain the existence of the link relationship between the two nodes in each target node pair, that is, the link prediction information, and then can know whether there is a link relationship between the two users with unknown link relationships.
[0235] In one example, step 509 includes:
[0236] Step 1, performing splicing processing on the content pair feature and the neighbor pair feature to obtain spliced pair features of the target node pair.
[0237] Step 2, performing calculation processing on the spliced pair features to obtain link prediction information of the target node pair.
[0238] Exemplarily, the device performs splicing processing on the content pair feature and the neighbor pair feature corresponding to each target node pair to obtain spliced pair features of each target node pair, and performs calculation processing on the spliced pair features of each target node pair based on each preset link prediction algorithm to obtain link prediction information of the target node pair. Furthermore, it can be known whether there is a link relationship between the two to-be-trained users with unknown link relationships.
[0239] 510. Training and processing the initial graph neural network based on the link prediction information of the target node pair and the link actual information to obtain a preset graph neural network; wherein the link actual information represents the existence of the link relationship between the actual two to-be-trained nodes.
[0240] Exemplarily, the device trains and processes the initial graph neural network based on the link prediction information and the actual link information of each target node pair, i.e., the actual existence of the link relationship between the two to-be-trained nodes, adjusts the model parameters of the initial graph neural network, for example, optimizes the model parameters using cross-entropy loss, the loss function encourages the model to give the observed edge a higher likelihood score than the randomly sampled negative edge, and then obtains the preset graph neural network for predicting whether there is a link relationship between the two nodes corresponding to the user.
[0241] In the embodiment, on the basis of the above embodiment, on the one hand, by calculating the aggregation of the node embedding representation of the first-order common neighbor, directly as the pair feature describing the to-be-predicted link, the shortcomings of insufficient information utilization of the existing algorithm can be made up; on the other hand, the attention mechanism is introduced, the attention scores of the embedding representations corresponding to the common neighbors are calculated, which are used as the weights when the common neighbors converge, the contribution of each adjacent node to the target link prediction is large or small, some high-influence nodes are highlighted, and some potentially irrelevant noise nodes are suppressed; the prediction performance of the model is improved, and the link prediction accuracy is further improved.
[0242] FIG. 10 is a structural schematic diagram of a link prediction device provided by an embodiment of the present application, as shown in FIG. 10, the device comprises:
[0243] The determining module 601 is configured to obtain a target original graph, the target original graph comprising at least one node representing an entity object, the entity object being a user, and determine an embedding representation of the node according to the target original graph; wherein the embedding representation represents the content feature of the node.
[0244] The generating module 602 is configured to generate a content pair feature of each target node pair according to the embedding representation of each target node pair in each node; wherein the target node pair comprises two nodes of a to-be-predicted link relationship; and the content pair feature represents the corresponding content features between the two nodes in the target node pair.
[0245] The processing module 603 is configured to determine at least one common neighbor node of the target node pair, and aggregate the embedding representations of the common neighbor nodes to obtain a neighbor pair feature of the target node pair; wherein the neighbor pair feature represents the corresponding topological structure features between the two nodes in the target node pair.
[0246] The prediction module 604 is configured to generate link prediction information of the target node pair according to the content pair feature and the neighbor pair feature of the target node pair; wherein the link prediction information represents the existence of the link relationship between the two nodes in the target node pair.
[0247] In a possible implementation, the processing module 603 is specifically configured to: perform aggregation processing on the embedding representations of the common neighbor nodes based on an attention mechanism, to obtain neighbor embedding representations of the target node pair; the neighbor embedding representations represent the initial topological structure features between the two nodes in the target node pair; and perform processing on the neighbor embedding representations based on a preset multi-layer perceptron module, to obtain neighbor pair features of the target node pair.
[0248] In a possible implementation, the processing module 603 is specifically configured to: determine attention scores corresponding to the common neighbor nodes according to the embedding representations of the common neighbor nodes; and perform aggregation processing on the embedding representations of the common neighbor nodes based on the attention mechanism and according to the attention scores, to obtain the neighbor embedding representations of the target node pair.
[0249] In a possible implementation, the prediction module 604 is specifically configured to: perform splicing processing on the content pair features and the neighbor pair features, to obtain spliced pair features of the target node pair; and perform calculation processing on the spliced pair features, to obtain link prediction information of the target node pair.
[0250] In a possible implementation, the determination module 601 is specifically configured to: determine initial representations of the nodes according to the target original graph; the initial representations represent initial content features of the nodes; perform dimension reduction processing on the initial representations, to obtain dense representations of the nodes; and perform graph convolution processing on the target original graph and the dense representations based on a preset graph neural network, to obtain embedding representations of the nodes.
[0251] In a possible implementation, the determination module 601 is specifically configured to: perform random walk processing on the nodes according to the target original graph, to obtain the initial representations of the nodes.
[0252] In a possible implementation, the determination module 601 is specifically configured to: perform linear transformation processing on the initial representations, to obtain transformed initial representations; perform batch normalization processing on the transformed initial representations, to obtain processed initial representations; and perform nonlinear activation processing on the processed initial representations, to obtain the dense representations.
[0253] In a possible implementation, the preset graph neural network includes at least one graph convolution layer; and the determination module 601 is specifically configured to: perform path random inactivation processing on the target original graph, to obtain a processed target original graph; perform graph convolution processing on the processed target original graph and the dense representations based on the graph convolution layer, to obtain hidden representations of the nodes; the hidden representations represent semantic data carried by the nodes; perform batch normalization processing on the hidden representations, to obtain processed hidden representations of the nodes; and perform nonlinear activation processing on the processed hidden representations, to obtain the embedding representations of the nodes.
[0254] The device of the embodiment can execute the technical solutions in the above method, and the specific implementation process and technical principles are the same, which will not be described here.
[0255] FIG. 11 is a structural schematic diagram of a model training device for link prediction provided by an embodiment of the application. As shown in FIG. 11, the device comprises:
[0256] The determining module 701 is configured to obtain a to-be-trained graph, the to-be-trained graph comprising at least one to-be-trained node representing an entity object, the entity object being a to-be-trained user; and determine an embedding representation of the to-be-trained node according to the to-be-trained graph; wherein the embedding representation represents a content feature of the to-be-trained node.
[0257] The generating module 702 is configured to generate a content pair feature of each target node pair according to the embedding representations of the target node pairs in each to-be-trained node; wherein the target node pair comprises two to-be-trained nodes of a to-be-predicted link relationship; and the content pair feature represents a corresponding content feature between the two to-be-trained nodes in the target node pair.
[0258] The processing module 703 is configured to determine at least one common neighbor node of the target node pair, and aggregate the embedding representations of the common neighbor nodes to obtain a neighbor pair feature of the target node pair; wherein the neighbor pair feature represents a corresponding topological structure feature between the two to-be-trained nodes in the target node pair.
[0259] The training module 704 is configured to train an initial graph neural network according to the content pair feature and the neighbor pair feature of the target node pair to obtain a preset graph neural network; wherein the preset graph neural network is used to process a target original graph of a link prediction device to generate link prediction information; and the link prediction information represents a predicted existence of a link relationship between two nodes.
[0260] In a possible implementation, the processing module 703 is specifically configured to: based on an attention mechanism, aggregate the embedding representations of the common neighbor nodes to obtain a neighbor embedding representation of the target node pair; wherein the neighbor embedding representation represents an initial topological structure feature between the two to-be-trained nodes in the target node pair; and based on a preset multi-layer perceptron module, process the neighbor embedding representation to obtain the neighbor pair feature of the target node pair.
[0261] In a possible implementation, the processing module 703 is specifically configured to: determine an attention score corresponding to the common neighbor node according to the embedding representation of the common neighbor node; and based on an attention mechanism, aggregate the embedding representations of the common neighbor nodes according to the attention scores to obtain the neighbor embedding representation of the target node pair.
[0262] In a possible implementation, the training module 704 is specifically configured to: generate link prediction information of the target node pair according to the content pair feature and the neighbor pair feature of the target node pair; and train the initial graph neural network according to the link prediction information of the target node pair and actual link information, to obtain the preset graph neural network; where the actual link information represents an actual link relationship between the two nodes to be trained.
[0263] In a possible implementation, the training module 704 is specifically configured to: splice the content pair feature and the neighbor pair feature to obtain spliced pair features of the target node pair; and calculate the spliced pair features to obtain the link prediction information of the target node pair.
[0264] In a possible implementation, the determining module 701 is specifically configured to: determine the initial representation of the node to be trained according to the training graph; where the initial representation represents an initial content feature of the node to be trained; perform dimension reduction processing on the initial representation to obtain the dense representation of the node to be trained; and perform graph convolution processing on the training graph and the dense representations based on the initial graph neural network to obtain the embedding representation of each node to be trained.
[0265] In a possible implementation, the determining module 701 is specifically configured to: perform random walk processing on the node to be trained according to the training graph to obtain the initial representation of the node to be trained.
[0266] In a possible implementation, the determining module 701 is specifically configured to: perform linear transformation processing on the initial representation to obtain a transformed initial representation; perform batch normalization processing on the transformed initial representation to obtain a processed initial representation; perform nonlinear activation processing on the processed initial representation to obtain an activated initial representation; and perform random deactivation processing on the activated initial representation to obtain the dense representation.
[0267] In a possible implementation, the initial graph neural network includes at least one graph convolution layer; and the determining module 701 is specifically configured to: perform path random deactivation processing on the training graph to obtain a processed training graph; perform graph convolution processing on the processed training graph and the dense representations based on the graph convolution layer to obtain hidden representations of the nodes to be trained; where the hidden representation represents semantic data carried by the node to be trained; perform batch normalization processing on the hidden representations to obtain processed hidden representations of the nodes to be trained; perform nonlinear activation processing on the processed hidden representations to obtain activated hidden representations of the nodes to be trained; and perform random deactivation processing on the activated hidden representations to obtain the embedding representation of each node to be trained.
[0268] The device of the embodiment can execute the technical solutions in the above method, and the specific implementation process and technical principles are the same, which will not be repeated here.
[0269] It should be noted that it should be understood that the division of each module of the above device is only a logical division of functions, and all or part of the physical entity can be integrated when actually implemented, or can be physically separated. And these modules can all be implemented in the form of software called by the processing element; all can be implemented in the form of hardware; some modules can be implemented in the form of software called by the processing element, and some modules can be implemented in the form of hardware. Each module can be a separately established processing element, or can be integrated in a chip of the above device, in addition, the functions of each module can also be stored in the memory of the above device in the form of program code, and called and executed by a processing element of the above device. In addition, all or part of these modules can be integrated together, or can be independently implemented. The processing element here can be an integrated circuit with signal processing capability. In the implementation process, each step of the above method or each module can be completed by the integrated logic circuit of the hardware in the processor element or the instruction in the form of software.
[0270] FIG. 12 is a structural schematic diagram of a computing device provided by an embodiment of the present application. As shown in FIG. 12, the computing device includes a memory 801, a processor 802, a memory 801, and a memory for storing executable instructions of the processor 802.
[0271] The processor 802 is configured to execute the method provided by the above embodiment.
[0272] The computing device further includes a receiver 803 and a transmitter 804. The receiver 803 is configured to receive instructions and data sent by other devices, and the transmitter 804 is configured to send instructions and data to external devices.
[0273] The specific implementation process of the processor can refer to the above method embodiments, which have similar implementation principles and technical effects, and will not be repeated here.
[0274] In the above embodiments, it should be understood that the processor can be a central processing unit (CPU), and can also be other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), etc. The general-purpose processor can be a microprocessor or any conventional processor, etc. The steps of the method disclosed in the application can be directly embodied as hardware processor execution, or a combination of hardware and software modules in the processor.
[0275] The memory can include a random access memory (RAM), and can also include a non-volatile memory (NVM), such as at least one disk memory.
[0276] The embodiments of the present application also provide a chip for running instructions, which is used to execute the technical solutions of the processing method in the above embodiments.
[0277] The embodiments of the present application also provide a computer readable storage medium, which stores computer execution instructions, and when the computer execution instructions run on a computer, the computer executes the technical solutions of the processing method in the above embodiments.
[0278] An exemplary readable storage medium is coupled to the processor, so that the processor can read information from the readable storage medium and write information to the readable storage medium. Of course, the readable storage medium can also be a component of the processor. The processor and the readable storage medium can be located in an application specific integrated circuit (ASIC). Of course, the processor and the readable storage medium can also exist as discrete components in the device.
[0279] The embodiments of the present application also provide a computer program product, which includes a computer program stored in a computer readable storage medium, at least one processor can read the computer program from the computer readable storage medium, and the at least one processor executes the computer program to realize the technical solutions of the processing method in the above embodiments.
[0280] If the functions are implemented in the form of software function units and sold or used as independent products, they can be stored in a computer readable storage medium. Based on this understanding, the technical solutions of the present application or the parts of the technical solutions that essentially contribute to the prior art or the parts of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes a plurality of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the embodiments of the method of the present application. The aforementioned storage medium includes a U disk, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a magnetic disk or an optical disk, and various media that can store program codes.
[0281] It can be understood by those skilled in the art that all or part of the steps of the above-mentioned method embodiments can be completed by program instruction related hardware. The aforementioned program can be stored in a computer readable storage medium. When the program is executed, the steps of the above-mentioned method embodiments are executed.
[0282] Finally, it should be noted that: those skilled in the art will easily think of other embodiments of the present application after considering the specification and practicing the application disclosed herein. The present application is intended to cover any variations, uses or adaptations of the present application that follow the general principles of the present application and include common knowledge or conventional technical means in the art that are not disclosed in the present application, and is not limited to the precise structure described above and shown in the drawings, and various modifications and changes can be made without departing from the scope thereof. The scope of the present application is only limited by the appended claims.
Claims
1. A link prediction method, comprising: obtaining a target original graph, the target original graph comprising at least one node representing an entity object, the entity object being a user; and determining an embedding representation of the node according to the target original graph; wherein the embedding representation represents a content feature of the node; generating a content pair feature of each target node pair in the target original graph according to an embedding representation of each target node pair in the target original graph; wherein the target node pair comprises two nodes of a link relationship to be predicted; and the content pair feature represents a corresponding content feature between the two nodes in the target node pair; determining at least one common neighbor node of the target node pair, and performing aggregation processing on an embedding representation of each common neighbor node to obtain a neighbor pair feature of the target node pair; wherein the neighbor pair feature represents a corresponding topological structure feature between the two nodes in the target node pair; generating link prediction information of the target node pair according to the content pair feature and the neighbor pair feature of the target node pair; wherein the link prediction information represents a predicted existence of a link relationship between the two nodes in the target node pair.
2. The method of claim 1, wherein, The aggregation processing on the embedding representation of each common neighbor node to obtain the neighbor pair feature of the target node pair comprises: performing aggregation processing on the embedding representation of each common neighbor node based on an attention mechanism to obtain a neighbor embedding representation of the target node pair; wherein the neighbor embedding representation represents an initial topological structure feature between the two nodes in the target node pair; performing processing on the neighbor embedding representation based on a preset multi-layer perceptron module to obtain the neighbor pair feature of the target node pair.
3. The method of claim 2, wherein, The aggregation processing on the embedding representation of each common neighbor node to obtain the neighbor embedding representation of the target node pair comprises: determining an attention score corresponding to the common neighbor node according to the embedding representation of the common neighbor node; performing aggregation processing on the embedding representation of each common neighbor node based on the attention mechanism according to the attention score to obtain the neighbor embedding representation of the target node pair.
4. The method of claim 1, wherein, The generation of the link prediction information of the target node pair according to the content pair feature and the neighbor pair feature of the target node pair comprises: performing splicing processing on the content pair feature and the neighbor pair feature to obtain a spliced pair feature of the target node pair; performing calculation processing on the spliced pair feature to obtain the link prediction information of the target node pair.
5. The method of any one of claims 1-4, wherein, The determination of the embedding representation of the node according to the target original graph comprises: determining an initial representation of the node according to the target original graph; wherein the initial representation represents an initial content feature of the node; performing dimensionality reduction processing on the initial representation to obtain a dense representation of the node; performing graph convolution processing on the target original graph and each dense representation based on a preset graph neural network to obtain the embedding representation of each node.
6. The method of claim 5, wherein, The determination of the initial representation of the node according to the target original graph comprises: According to the target original graph, a random walk process is performed on the nodes to obtain an initial representation of the nodes.
7. The method of claim 5, wherein, The initial representation is subjected to dimension reduction processing to obtain a dense representation of the nodes, including: The initial representation is subjected to linear transformation processing to obtain a transformed initial representation; The transformed initial representation is subjected to batch normalization processing to obtain a processed initial representation; The processed initial representation is subjected to nonlinear activation processing to obtain the dense representation.
8. The method of claim 5, wherein, The preset graph neural network includes at least one graph convolution layer; based on the preset graph neural network, the target original graph and each dense representation are subjected to graph convolution processing to obtain an embedding representation of each node, including: The target original graph is subjected to path random inactivation processing to obtain a processed target original graph; Based on the graph convolution layer, the processed target original graph and each dense representation are subjected to graph convolution processing to obtain an implicit representation of each node; wherein the implicit representation represents semantic data carried by the node; Each implicit representation is subjected to batch normalization processing to obtain a processed implicit representation of each node; Each processed implicit representation is subjected to nonlinear activation processing to obtain an embedding representation of each node.
9. A model training method applied to link prediction, comprising: obtaining a to-be-trained graph, the to-be-trained graph including at least one to-be-trained node representing an entity object, the entity object being a to-be-trained user; and determining an embedding representation of the to-be-trained node according to the to-be-trained graph; wherein the embedding representation represents the content feature of the to-be-trained node; generating a content pair feature of each target node pair according to the embedding representation of each target node pair in each to-be-trained node; wherein the target node pair includes two to-be-trained nodes of a to-be-predicted link relationship; the content pair feature represents the corresponding content features between the two to-be-trained nodes in the target node pair; determining at least one common neighbor node of the target node pair, and aggregating the embedding representations of each common neighbor node to obtain a neighbor pair feature of the target node pair; wherein the neighbor pair feature represents the corresponding topological structure feature between the two to-be-trained nodes in the target node pair; training an initial graph neural network according to the content pair feature and the neighbor pair feature of the target node pair to obtain a preset graph neural network; wherein the preset graph neural network is used to process the target original graph of any one of claims 1-8 to generate link prediction information; the link prediction information represents the existence of the predicted link relationship between the two nodes.
10. The method of claim 9, wherein, The embedding representations of each common neighbor node are aggregated to obtain a neighbor pair feature of the target node pair, including: based on an attention mechanism, the embedding representations of each common neighbor node are aggregated to obtain a neighbor embedding representation of the target node pair; wherein the neighbor embedding representation represents the initial topological structure feature between the two to-be-trained nodes in the target node pair; The neighbor pair features of the target node pair are obtained by processing the neighbor embedding representations based on a preset multi-layer perceptron module.
11. The method of claim 10, wherein, The neighbor embedding representations of the target node pair are obtained by aggregating the embedding representations of the common neighbor nodes based on an attention mechanism, including: An attention score corresponding to each of the common neighbor nodes is determined according to the embedding representation of the common neighbor node. The embedding representations of the common neighbor nodes are aggregated according to the attention scores based on the attention mechanism, to obtain the neighbor embedding representations of the target node pair.
12. The method of claim 9, wherein, The preset graph neural network is obtained by training the initial graph neural network according to the content pair features and the neighbor pair features of the target node pair, including: Link prediction information of the target node pair is generated according to the content pair features and the neighbor pair features of the target node pair. The preset graph neural network is obtained by training the initial graph neural network according to the link prediction information and the link actual information of the target node pair, wherein the link actual information represents the existence of the link relationship between the two nodes to be trained.
13. The method of claim 12, wherein, The link prediction information of the target node pair is generated according to the content pair features and the neighbor pair features of the target node pair, including: The content pair features and the neighbor pair features are spliced to obtain spliced pair features of the target node pair. The spliced pair features are calculated to obtain the link prediction information of the target node pair.
14. The method of any one of claims 9-13, wherein, The embedding representations of the nodes to be trained are determined according to the training graph, including: An initial representation of the node to be trained is determined according to the training graph, wherein the initial representation represents the initial content features of the node to be trained. The initial representation is reduced in dimension to obtain a dense representation of the node to be trained. The embedding representations of the nodes to be trained are obtained by performing graph convolution on the training graph and the dense representations based on the initial graph neural network.
15. The method of claim 14, wherein, The initial representation of the node to be trained is determined according to the training graph, including: The initial representation of the node to be trained is obtained by performing random walk processing on the node to be trained according to the training graph.
16. The method of claim 14, wherein, The initial representation is reduced in dimension to obtain a dense representation of the node to be trained, including: The initial representation is linearly transformed to obtain a transformed initial representation. The transformed initial representation is batch-normalized to obtain a processed initial representation. The processed initial representation is nonlinearly activated to obtain an activated initial representation. The activated initial representation is randomly inactivated to obtain the dense representation.
17. The method of claim 14, wherein, The initial graph neural network includes at least one graph convolution layer; the embedding representations of the nodes to be trained are obtained by performing graph convolution on the training graph and the dense representations based on the initial graph neural network, including: The training graph is path randomly inactivated to obtain a processed training graph. performing graph convolution processing on the processed target graph and the dense representations to obtain hidden representations of the target nodes, wherein the hidden representations represent semantic data carried by the target nodes; performing batch normalization processing on the hidden representations to obtain processed hidden representations of the target nodes; performing nonlinear activation processing on the processed hidden representations to obtain activated hidden representations of the target nodes; performing random deactivation processing on the activated hidden representations to obtain embedding representations of the target nodes.
18. A link prediction apparatus, comprising: a determination module configured to obtain a target original graph, the target original graph comprising at least one node representing an entity object, the entity object being a user; and determine embedding representations of the nodes according to the target original graph, wherein the embedding representations represent content features of the nodes; a generation module configured to generate content pair features of each target node pair according to embedding representations of the target node pairs in the target nodes, wherein the target node pair comprises two target nodes of which link relationships are to be predicted, and the content pair features represent corresponding content features between the two target nodes in the target node pair; a processing module configured to determine at least one common neighbor node of the target node pair, and aggregate embedding representations of the common neighbor nodes to obtain neighbor pair features of the target node pair, wherein the neighbor pair features represent corresponding topological structure features between the two target nodes in the target node pair; a prediction module configured to generate link prediction information of the target node pair according to the content pair features and the neighbor pair features of the target node pair, wherein the link prediction information represents a predicted existence of link relationships between the two target nodes in the target node pair.
19. A model training apparatus applied to link prediction, comprising: a determination module configured to obtain a target original graph, the target original graph comprising at least one node representing an entity object, the entity object being a user; and determine embedding representations of the nodes according to the target original graph, wherein the embedding representations represent content features of the nodes; a generation module configured to generate content pair features of each target node pair according to embedding representations of the target node pairs in the target nodes, wherein the target node pair comprises two target nodes of which link relationships are to be predicted, and the content pair features represent corresponding content features between the two target nodes in the target node pair; a processing module configured to determine at least one common neighbor node of the target node pair, and aggregate embedding representations of the common neighbor nodes to obtain neighbor pair features of the target node pair, wherein the neighbor pair features represent corresponding topological structure features between the two target nodes in the target node pair; The training module is configured to train an initial graph neural network according to the content pair features and the neighbor pair features of the target node pair, to obtain a preset graph neural network; the preset graph neural network is configured to process the target original graph in claim 18 to generate link prediction information; the link prediction information represents a predicted link relationship between two nodes.
20. A computing device comprising: a memory, a processor; the memory stores computer-executable instructions; the processor executes the computer-executable instructions stored in the memory, so that the processor executes the method in any one of claims 1-8 or the method in any one of claims 9-17.
21. A computer-readable storage medium, the computer-readable storage medium storing computer-executable instructions, the computer-executable instructions being executed by a processor to implement the method in any one of claims 1-8 or the method in any one of claims 9-17.
22. A computer program product, comprising a computer program, the computer program being executed by a processor to implement the method in any one of claims 1-8 or the method in any one of claims 9-17.
Citation Information
Patent Citations
Network link prediction method based on multiple semantic influences of multiple neighbor nodes
CN110851491A
GNN double-source learning-based big data access control entity relationship prediction method
CN115712755A
Method and device for generating embedded feature vector of user
CN116484865A
Link prediction method and system based on topological structure and attribute information
CN116932938A
Graph structure prediction method and device and electronic equipment
CN118093571A