Search

CN-116662566-B - Heterogeneous information network link prediction method based on contrast learning mechanism

CN116662566BCN 116662566 BCN116662566 BCN 116662566BCN-116662566-B

Abstract

The invention discloses a heterogeneous information network link prediction method based on a contrast learning mechanism, which comprises the following steps of adopting a text encoder to encode texts into low-dimensional vectors to generate text representations, adopting a graph encoder to encode structural features, heterogeneous features and self-supervision information of a heterogeneous information network to obtain graph representations, carrying out pretraining alignment on the text representations and the graph representations through contrast learning, introducing automatically generated learnable continuous prompt vectors, providing identified natural language sentences to the text encoder, comparing the natural language sentences with the structures and the heterogeneous feature representations generated by the graph encoder to generate weights in classification, fusing to obtain single representations, and carrying out link prediction of the heterogeneous information network by utilizing the obtained single representations. The method can obtain more excellent and remarkable prediction performance in the link prediction task of the heterogeneous information network.

Inventors

  • XIAO WEIDONG
  • ZHAO XIANG
  • WU DAN
  • WANG YUHENG
  • ZENG WEIXIN
  • TAN ZHEN
  • FANG YANG

Assignees

  • 中国人民解放军国防科技大学

Dates

Publication Date
20260508
Application Date
20230523

Claims (9)

  1. 1. A heterogeneous information network link prediction method based on a contrast learning mechanism is characterized by comprising the following steps: step1, a text encoder is adopted to encode the text into a low-dimensional vector, and a text representation is generated; step 2, encoding structural features, heterogeneous features and self-supervision information of the heterogeneous information network by adopting a map encoder to obtain a map representation; Step 3, pre-training and aligning the text representation and the chart representation through contrast learning; step 4, introducing automatically generated learnable continuous prompt vectors, providing the identified natural language sentences to a text encoder, comparing the natural language sentences with the structure and heterogeneous characteristic representation generated by the atlas encoder to generate weights in classification, and fusing to obtain a single representation; step 5, utilizing the obtained single representation to conduct link prediction of the heterogeneous information network; the step 2 specifically includes the following steps: step 201, sampling heterogeneous subgraphs, wherein for a given node, the subgraphs around the node need to be sampled first; Step 202, capturing structural information of the sub-graph using the self-encoder, given the adjacency matrix A of the sub-graph, which will first be processed by the encoder to generate a multi-layered potential representation, and then the decoder reversing the above process to obtain a reconstructed output The self-encoder aims to minimize reconstruction errors of the input and output, so that nodes with similar structures have similar representations, and the loss function L structure is calculated as follows: Wherein B is a penalty sparse applied to non-zero elements to alleviate the sparsity problem, as indicated by bit-wise multiplication, Representing a regularization operation; Step 203, exploring heterogeneous characteristics of heterogeneous information network, grouping nodes with the same type together, applying Bi-LSTM on each group to model type-specific characteristics, node group of given type T j Representation of node v The calculation is as follows: wherein Bi-LSTM { v } represents that Bi-LSTM is applied to the type grouping of node v, Representing node groups Is the number of (3); An attention mechanism is then applied to aggregate all types of groups to generate a representation h v of a given node, Where δ represents the activation function, u ε R d is the weight parameter, u T represents the transpose of u, Is a representation of node v, { T } represents a set of types, α v,j represents an attention weight; Step 204, pre-training the subgraph based on self-supervision information, introducing two pre-training tasks, a mask node modeling task and an edge reconstruction task, so as to realize the graph exploration of the node level and the edge level.
  2. 2. The heterogeneous information network link prediction method based on contrast learning mechanism as claimed in claim 1, wherein the MASK node modeling task performs ranking according to the ranking of nodes, randomly extracts the nodes with preset proportion and replaces them with [ "MASK ] identifiers, the ranked nodes are sent to the encoder of the transducer, the representation generated by Bi-LSTM is used as the identifier representation, the ranking information is used as the position vector, and the hidden layer learned by the transducer encoder Into the feed-forward layer to predict the target node, expressed mathematically as: p v =softmax(W MNM z v ), Where z v is the output of the feed-forward layer, feedforward () represents the activation function represented by the feed-forward layer, softmax () represents the activation function, W MNM ∈V v ×d is the weight shared with the input node representation matrix for classification, V v is the number of nodes of the subgraph, d is the dimension of the hidden layer vector, p v is the predicted distribution of V on all nodes, and in training, a one-hot label is used And prediction The cross entropy between the two, the loss function L MNM is calculated as follows: Where y i and p i are the ith components of y i and p i , y i represents the set of labels, and p i represents the set of prediction probabilities; The edge reconstruction task samples positive edges and negative edges in the subgraph, wherein the positive edges are edges which do exist in the original subgraph, the negative edges do not exist in the original subgraph, and the sum N S of the positive edges and the negative edges is given, and the score of the edge reconstruction is calculated through the inner product between a pair of nodes, namely Is a calculated score, h v is a representation of node v, is an inner product, h u is a representation of node u, and the binary cross entropy between predicted and true edges is employed to calculate the loss function of edge reconstruction L ER : N S represents the number of node pairs, binaryCrossEntropy () represents the binary cross entropy, e uv represents the actual score of node u and node v, and (u, v) represents the conjoined edges of node u and node v.
  3. 3. The heterogeneous information network link prediction method based on a contrast learning mechanism according to claim 2, wherein the sampling of sub-graphs around the nodes uses a sampling strategy with a restarted random walk, and the neighborhood of a given node v is traversed iteratively, and a certain probability is returned to the starting node v, so that the random walk strategy reaches the nodes with high rank first for sampling the nodes with higher importance, and the traversal is limited to sampling all types of nodes for making the graph encoder have heterogeneity.
  4. 4. The method of claim 1, wherein the contrast learning is used to align text representations with graphic representations during training, wherein the learning objective is designed to compare the loss function, and wherein a set of text-sub-graph pairs is given to maximize the similarity score of the matched text-sub-graph pairs while minimizing the score of the unmatched text-sub-graph pairs.
  5. 5. The method for heterogeneous information network link prediction based on contrast learning mechanism according to claim 4, wherein in said contrast learning process, given a node v, the node learned by the graph encoder is denoted as H, and the weight vector generated by the text encoder is denoted as H Where K represents the number of categories, each weight w i is learned from the hint, and the predictive probability is calculated as: Where τ is the learned temperature hyper-parameter, < -, & gtrepresents the similarity score, < w i , H > represents the text weight vector w i and the node represents the similarity score of vector H.
  6. 6. The heterogeneous information network link prediction method based on the contrast learning mechanism according to claim 2, wherein the automatically generated learnable and continuous hint vectors introduced in step 4 are continuous vectors learned from end to end in data to replace discrete text words, and the hint P input to the text encoder is designed as: P=[V 1 ][V 2 ]...[V M ][CLASS], Wherein, [ CLASS ] represents CLASS labels of nodes, [ V M ] is a word vector with the same dimension as the word representation in the training stage, M is a super-parameter, represents the number of continuous Text vectors in the prompt, and after the continuous prompt P is input into a Text coder Text (), a CLASS weight vector representing the concept of the node can be obtained, and the prediction probability is calculated as Wherein the class labels in each hint P i are replaced by the word vector representation of the i-th class name, text (P i ) represents the vector resulting from feeding hint P i into the Text encoder.
  7. 7. The method of claim 6, wherein in step 4, a more accurate hint vector is obtained, and wherein a text representation of the class label and a node representation in the subgraph are input to the text-subgraph self-attention layer using the text-encoder-atlas-encoder residual connection to utilize the given node's context Wen Zitu, to help the text feature find the most relevant context node of the given node; After obtaining the output D e of the text-to-subgraph comparator, the text features are updated by residual connection, Text(P)←Text(P)+λD e Where λ is a learnable parameter for controlling the extent of the residual connection.
  8. 8. The heterogeneous information network link prediction method based on a contrast learning mechanism of claim 1, wherein the text encoder uses Sentence-BERT model to generate a text representation of a fixed size.
  9. 9. The method for heterogeneous information network link prediction based on a contrast learning mechanism of claim 8, wherein λ is initialized to 10 -4 .

Description

Heterogeneous information network link prediction method based on contrast learning mechanism Technical Field The invention relates to the technical field of knowledge graph networks in natural language processing, in particular to a heterogeneous information network link prediction method based on a contrast learning mechanism. Background Heterogeneous information networks are ubiquitous. Interactions between users and items in social networks, knowledge maps, and search and recommendation systems can be modeled as networks with multiple types of nodes and edges. A text heterogeneous information network is a network with text information, such as titles and summaries of paper nodes in an academic network, that can provide productive ancillary information for downstream tasks. Most current efforts on heterogeneous information networks ignore such textual information and map the nodes of the graph to a low-dimensional representation based only on structural information. To fill this gap, some models mining heterogeneous information networks suggest integrating text information into node representations. They mainly design a framework that combines structural information of nodes with textual information to generate a single node representation. The text network embedding model mentioned above faces many limitations. First, they can only classify nodes with trained labels, in other words, they are not suitable for small sample learning settings. In small sample learning, we need to migrate a pre-trained model to classify nodes with invisible labels during the test phase. In practice, only a few tags are typically available, which presents a serious challenge to maintaining performance. Second, previous methods of using text information were originally designed for homogeneous information networks, and no effort has been made to solve the problem of small sample learning on text heterogeneous information networks. To solve the small sample learning problem, natural language processing related studies (e.g., chatGPT) have proposed prompt learning, which reformulates the downstream task to look like a pre-training task. Prompt learning, whether or not fine tuning is present, facilitates rapid application of a priori knowledge to new tasks, thereby enhancing small sample learning. Recently, hint learning has also been employed in multimodal scenes to align image and text data. However, no prompt learning-based technique has been used to process atlases and text data. In view of the above, a heterogeneous information network link prediction method based on a contrast learning mechanism is provided, prompt learning is used for map data, the problem of small sample learning on a text heterogeneous information network is solved, and a more efficient and accurate heterogeneous information network link prediction task result is obtained. Disclosure of Invention The present invention aims to solve at least one of the technical problems existing in the prior art. Therefore, the invention discloses a heterogeneous information network link prediction method based on a contrast learning mechanism. The method adopts a text encoder to encode text information, adopts a map encoder to encode structure and heterogeneous characteristics and self-supervision information, adopts a contrast learning mechanism for aligning text representation and network representation, and adopts a learnable continuous vector type prompt learning framework for solving the problem of small samples on a text heterogeneous information network. A heterogeneous information network link prediction method based on a contrast learning mechanism, the method comprising: step1, a text encoder is adopted to encode the text into a low-dimensional vector, and a text representation is generated; step 2, encoding structural features, heterogeneous features and self-supervision information of the heterogeneous information network by adopting a map encoder to obtain a map representation; Step 3, pre-training and aligning the text representation and the chart representation through contrast learning; step 4, introducing automatically generated learnable continuous prompt vectors, providing the identified natural language sentences to a text encoder, comparing the natural language sentences with the structure and heterogeneous characteristic representation generated by the atlas encoder to generate weights in classification, and fusing to obtain a single representation; and 5, carrying out link prediction of the heterogeneous information network by using the obtained single representation. Specifically, the text encoder uses Sentence-BERT models to generate a text representation of a fixed size. Specifically, the step 2 specifically includes the following steps: step 201, sampling heterogeneous subgraphs, wherein for a given node, the subgraphs around the node need to be sampled first; Step 202, capturing structural information of the sub-graph using the self-encoder,