Node classification method and device, electronic equipment and storage medium

The feature representation of nodes is fused through topology-aware graph processing and semantic awareness processing, which solves the problem of spatial differences between graph data and large language models, and improves the generalization ability of the model and the accuracy of cross-domain node classification.

CN120523944AActive Publication Date: 2025-08-22北京数原数字化城市研究中心
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202510672760.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-23
Publication Date
2025-08-22
Estimated Expiration
2045-05-23

AI Technical Summary

Technical Problem

The spatial difference between graph data and large language models makes it difficult to directly fusion, resulting in low model generalization ability in node classification tasks.

Method used

The nodes are fused through topology-aware graph processing and semantic awareness processing, and enhanced feature representations are generated, and classified using large language models.

Benefits of technology

The alignment of graphs and language space is realized, and the generalization ability and classification accuracy of the model in cross-domain node classification tasks are improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120523944A_ABST
    Figure CN120523944A_ABST
Patent Text Reader

Abstract

The invention discloses a node classification method and device, electronic equipment and a storage medium, and the method comprises the steps: obtaining a to-be-processed text attribute graph which comprises a plurality of nodes; performing topology perception graph processing on each node in the plurality of nodes to obtain a topology perception graph representation of each node, and performing semantic perception processing on each node to obtain a semantic perception representation of each node, the topology perception graph representation being used for mapping each node to a unified potential space; carrying out fusion processing on the topology perception graph representation of each node and the semantic perception representation of each node to obtain an enhanced feature representation of each node; and classifying the enhanced feature representation of each node through a large language model to obtain a classification result of each node. In this way, the graph data can be aligned with the language space in the node classification task, the generalization ability of the model in the cross-domain is effectively improved, and then an accurate classification result is obtained in the cross-domain node classification task.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a node classification method, device, electronic device and storage medium. Background Art

[0002] Currently, aligning the spatial relationships between graph data and language models is a core challenge. Specifically, graph data is inherently a non-Euclidean space, defined by an adjacency matrix and node interactions; whereas large language models process sequential text based on an optimized Euclidean vector space. This structural difference leads to incompatible representations between graph data and language models.

[0003] It can be seen that due to their spatial differences, it is difficult to directly fuse graph data with the language space of a large language model. Therefore, there is a spatial alignment problem in the node classification task, resulting in low generalization ability of the model. Summary of the Invention

[0004] The embodiments of the present application provide a node classification method, device, electronic device, and storage medium to align graph data with the language space in node classification tasks, effectively improving the model's cross-domain generalization capability.

[0005] In a first aspect, an embodiment of the present application provides a node classification method, including:

[0006] Obtaining a text attribute graph to be processed, wherein the text attribute graph includes a plurality of nodes;

[0007] performing topology-aware graph processing on each of the plurality of nodes to obtain a topology-aware graph representation of each node, and performing semantic-aware processing on each node to obtain a semantic-aware representation of each node, wherein the topology-aware graph representation is used to map each node to a unified latent space;

[0008] Fusing the topological perception graph representation of each node and the semantic perception representation of each node to obtain an enhanced feature representation of each node;

[0009] The enhanced feature representation of each node is classified by a large language model to obtain a classification result of each node.

[0010] Optionally, performing topology perception graph processing on each of the multiple nodes to obtain a topology perception graph representation of each node includes:

[0011] Processing the text attribute graph to obtain a first adjacency matrix corresponding to the text attribute graph;

[0012] Performing Laplace normalization on the first adjacency matrix to obtain a second adjacency matrix;

[0013] Performing singular value decomposition on the second adjacency matrix to obtain a topology-aware graph representation of each node.

[0014] Optionally, performing semantic-aware processing on each node to obtain a semantic-aware representation of each node includes:

[0015] Processing the text information corresponding to each node to obtain an embedding vector for each word corresponding to each node;

[0016] Calculate the embedding vector of each word corresponding to each node by using the word frequency inverse document frequency algorithm to obtain the semantic embedding of each node;

[0017] Graph encoding is performed on the semantic embedding of each node to obtain a semantically perceptual representation of each node.

[0018] Optionally, processing the text information corresponding to each node to obtain an embedding vector for each word corresponding to each node includes:

[0019] Converting the text information corresponding to each node into a word sequence corresponding to each node through the word segmenter of the large language model;

[0020] The word sequence corresponding to each node is processed through the embedding layer of the large language module to obtain an embedding vector for each word corresponding to each node.

[0021] Optionally, the large language model is obtained by the following steps:

[0022] Obtain the true classification results, graph embedding matrix, text embedding matrix, and summary embedding matrix corresponding to the training text attribute graph;

[0023] Based on the graph embedding matrix, the text embedding matrix, and the summary embedding matrix, determining a first similarity between the graph embedding matrix and the text embedding matrix, a second similarity between the graph embedding matrix and the summary embedding matrix, and a third similarity between the text embedding matrix and the summary embedding matrix;

[0024] Model training is performed based on the first similarity, the second similarity, the third similarity and the true classification result, and the large language model is obtained after the training is completed.

[0025] Optionally, determining, based on the graph embedding matrix, the text embedding matrix, and the summary embedding matrix, a first similarity between the graph embedding matrix and the text embedding matrix, a second similarity between the graph embedding matrix and the summary embedding matrix, and a third similarity between the text embedding matrix and the summary embedding matrix includes:

[0026] Calculating a first cosine similarity matrix between the graph embedding matrix and the text embedding matrix based on the graph embedding matrix and the text embedding matrix, wherein the first cosine similarity matrix is ​​used to indicate the first similarity;

[0027] calculating, based on the graph embedding matrix and the summary embedding matrix, a second cosine similarity matrix between the graph embedding matrix and the summary embedding matrix, wherein the second cosine similarity matrix is ​​used to indicate the second similarity;

[0028] Based on the text embedding matrix and the summary embedding matrix, a third cosine similarity matrix is ​​calculated between the text embedding matrix and the summary embedding matrix, where the third cosine similarity matrix is ​​used to indicate the third similarity.

[0029] Optionally, performing model training based on the first similarity, the second similarity, the third similarity, and the true classification result, and obtaining the large language model after the training, includes:

[0030] Determining a first loss value based on the first cosine similarity matrix and the true classification result through a cross entropy loss function;

[0031] Determining a second loss value based on the second cosine similarity matrix and the true classification result by using the cross entropy loss function;

[0032] Determining a third loss value based on the third cosine similarity matrix and the true classification result by using the cross entropy loss function;

[0033] Model training is performed based on the first loss value, the second loss value, and the third loss value, and the large language model is obtained after the training is completed.

[0034] In a second aspect, an embodiment of the present application provides a node classification device, including:

[0035] A data acquisition module, configured to acquire a text attribute graph to be processed, wherein the text attribute graph includes a plurality of nodes;

[0036] a perception processing module, configured to perform topological perception graph processing on each of the plurality of nodes to obtain a topological perception graph representation of each node, and to perform semantic perception processing on each node to obtain a semantic perception representation of each node, wherein the topological perception graph representation is used to map each node to a unified latent space;

[0037] A fusion processing module, configured to fuse the topological perception graph representation of each node and the semantic perception representation of each node to obtain an enhanced feature representation of each node;

[0038] The node classification module is used to classify the enhanced feature representation of each node through a large language model to obtain a classification result of each node.

[0039] In a third aspect, an embodiment of the present application provides an electronic device, the device comprising: a processor, a memory, and a system bus;

[0040] The processor and the memory are connected via the system bus;

[0041] The memory is used to store a program, wherein the program includes instructions, and when the instructions are executed by the processor, the processor is enabled to perform any implementation step of the above-mentioned node classification method.

[0042] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, any implementation step of the above-mentioned node classification method is implemented.

[0043] It can be seen from the above technical solutions that the embodiments of the present application have the following advantages:

[0044] In an embodiment of the present application, after obtaining a text attribute graph to be processed including multiple nodes, each of the multiple nodes can be subjected to topological perception graph processing to obtain a topological perception graph representation of each node, and semantic perception processing can be performed on each node to obtain a semantic perception representation of each node. Then, the topological perception graph representation of each node and the semantic perception representation of each node can be fused to obtain an enhanced feature representation of each node, and the enhanced feature representation of each node can be classified by a large language model to obtain a classification result of each node. It can be seen that through topological perception graph processing, the topological relationship of the graph data can be captured and each node can be mapped to a unified potential space; through semantic perception processing, the text information related to the nodes in the graph can be captured to generate a semantic perception representation that can reflect the semantics of the text. In this way, the enhanced feature representation obtained by fusion processing of the topological perception graph representation and the semantic perception representation is a representation with spatial consistency. Therefore, the alignment of the graph and the language space can be achieved, thereby effectively solving the spatial alignment problem, enabling the model to achieve more powerful generalization capabilities between different fields, and thus achieving accurate classification results in cross-domain node classification tasks. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] Figure 1 A flowchart of a node classification method provided in an embodiment of the present application;

[0046] Figure 2 A schematic diagram of the overall framework of a node classification method provided in an embodiment of the present application;

[0047] Figure 3 A schematic diagram of the overall framework of another node classification method provided in an embodiment of the present application;

[0048] Figure 4 A schematic diagram of the structure of a node classification device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0049] As mentioned earlier, in practical applications, due to the spatial differences between graph data and language models, it is difficult to directly fuse graph data with the language space of large language models. Therefore, there is a spatial alignment problem in node classification tasks, resulting in low generalization ability of the model.

[0050] Based on this, in order to solve the above problems, an embodiment of the present application provides a node classification method, including: after obtaining a text attribute graph to be processed including multiple nodes, topology-aware graph processing can be performed on each of the multiple nodes to obtain a topology-aware graph representation of each node, and semantic-aware processing can be performed on each node to obtain a semantic-aware representation of each node. Then, the topology-aware graph representation of each node and the semantic-aware representation of each node can be fused to obtain an enhanced feature representation of each node, and the enhanced feature representation of each node can be classified using a large language model to obtain a classification result for each node.

[0051] As can be seen, topology-aware graph processing can capture the topological relationships of graph data and map each node to a unified latent space; semantic-aware processing can capture textual information related to nodes in the graph and generate semantic-aware representations that reflect the semantics of the text. In this way, the enhanced feature representation obtained by fusing the topology-aware graph representation and the semantic-aware representation is a spatially consistent representation. Therefore, it is possible to align the graph with the language space, effectively solving the spatial alignment problem, enabling the model to achieve stronger generalization capabilities across different domains, and thus achieving accurate classification results in cross-domain node classification tasks.

[0052] It should be noted that the embodiments of the present application do not limit the execution entity of the node classification method. For example, the node classification method of the embodiments of the present application can be applied to data processing devices such as terminal devices or servers. The terminal devices can be electronic devices such as smartphones, computers, personal digital assistants (PDAs), and tablet computers. The servers can be standalone servers, clustered servers, or cloud servers.

[0053] In order to make the purpose, technical solutions and advantages of the embodiments of this application more clear, the technical solutions in the embodiments of this application will be clearly and completely described below in conjunction with the drawings in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.

[0054] Figure 1 A flowchart of a node classification method provided in an embodiment of the present application. Figure 1 As shown, the node classification method provided in the embodiment of the present application may include the following steps S101 to S104.

[0055] S101: Obtain a text attribute graph to be processed, where the text attribute graph includes a plurality of nodes.

[0056] In an embodiment of the present application, the text attribute graph to be processed may be directly input by a user, or may be pre-stored in a database, and the text attribute graph may be obtained from the database when executing a node classification task.

[0057] In the text attribute graph, each node represents a text entity, such as a document, a sentence, etc. The attributes of the node include text information related to the entity, such as the content and title of the document.

[0058] For ease of understanding, for example, a text attribute graph can represent a paper citation network. In this network, each node represents a paper, and node attributes can include text information such as the paper's title, abstract, and keywords. Edges represent citation relationships between papers, and edge attributes can include text information such as the reason for the citation and the context of the citation.

[0059] S102: performing topology-aware graph processing on each of the multiple nodes to obtain a topology-aware graph representation of each node, and performing semantic-aware processing on each node to obtain a semantic-aware representation of each node, wherein the topology-aware graph representation is used to map each node to a unified latent space.

[0060] For ease of understanding, combined Figure 2 and Figure 3 As shown, when performing topology-aware graph processing on each node, a topology-aware graph representation module can be used. This module includes a Laplace normalization module and a singular value decomposition module. This allows the Laplace normalization module to perform Laplace normalization on the first adjacency matrix corresponding to the text attribute graph, and then perform singular value decomposition on the resulting second adjacency matrix. This captures the global topological relationships of the graph data and generates a structured graph representation, resolving the problem of global topological blind spots.

[0061] Accordingly, the process of performing topology perception graph processing on each of the multiple nodes may include the following steps 21 to 23:

[0062] Step 21: Process the text attribute graph to obtain a first adjacency matrix corresponding to the text attribute graph.

[0063] In the embodiment of the present application, the specific implementation method for processing the text attribute graph into the first adjacency matrix may not be specifically limited, and may be implemented using any existing or future algorithm for converting graph data into an adjacency matrix.

[0064] Step 22: Perform Laplace normalization on the first adjacency matrix to obtain a second adjacency matrix.

[0065] Here, by performing Laplace normalization on the first adjacency matrix, the sum of the weights of each node's neighbors is equal to 1. This eliminates the impact of differences in node degrees on the graph representation, making the graph data representation more stable and uniform, and avoiding the representation bias caused by different node degrees in higher-order adjacency matrices. This can better reflect the relative relationships between nodes and improve the quality of graph data representation.

[0066] Next, the Laplace-normalized matrices are superimposed into high-order adjacency matrices. This allows us to capture higher-order connection patterns between nodes, i.e., consider the connection relationships between nodes through multi-step paths, thereby more comprehensively describing the topological structure of the graph and capturing the global topological relationships of the graph data, rather than just the local adjacency relationships.

[0067] In the embodiment of the present application, the process of performing Laplace normalization on the first adjacency matrix and superimposing it into a high-order adjacency matrix can be shown as the following formula (1):

[0068] (1)

[0069] in, is the first adjacency matrix of order k after Laplace normalization, is the second adjacency matrix.

[0070] In this way, the second adjacency matrix is ​​a high-order adjacency matrix, and this method of adding multiple Laplace-normalized first adjacency matrices can capture various connection relationships between nodes, including one-hop connections (direct connections) and multi-hop connections (connected through intermediate nodes), thereby preserving the global topological structure of the graph data.

[0071] Step 23: Perform singular value decomposition on the second adjacency matrix to obtain a topology-aware graph representation of each node.

[0072] Here, singular value decomposition is a matrix decomposition technique that can decompose a matrix into the product of three matrices, which contains information such as singular values ​​and singular vectors. In the embodiment of the present application, taking node i as an example, the process of performing singular value decomposition on the second adjacency matrix can be shown as the following formula (2):

[0073] (2)

[0074] in, is the topological code of node i, U and V are orthogonal matrices, is a diagonal matrix, is the high-order adjacency function of layer l.

[0075] Through singular value decomposition, nodes can be mapped to a unified latent space, so that the representation of nodes in this space can better capture the global topological characteristics of the graph data, and at the same time have better compatibility with the language space, so that nodes from different graph datasets can be compared and processed in the same space, solving the spatial alignment problem.

[0076] Furthermore, still combined Figure 2 and Figure 3 As shown in the figure, semantic-aware processing of each node can be implemented using a semantic-aware module. This module can include a large language model tokenizer and embedding layer, a term frequency-inverse document frequency (TF-IDF) module, and a graph encoder module. In this way, the tokenizer module can be used to convert text descriptions into word sequences. This sequence is then processed through the embedding layer of the large language model to obtain an embedding vector for each word. The TF-IDF module then measures the importance of words in the document, ensuring that the generated node representation accurately captures the semantic information of the text. Finally, the graph encoder module extracts the structural information of the nodes.

[0077] Accordingly, the process of performing semantic perception processing on each of the multiple nodes may include the following steps 24 to 26:

[0078] Step 24: Process the text information corresponding to each node to obtain the embedding vector of each word corresponding to each node.

[0079] In specific implementations, the large language model's word segmenter first converts the text information corresponding to each node into a word sequence corresponding to each node. These word sequences are then input into the large language model's embedding layer, which processes the word sequence corresponding to each node to obtain an embedding vector for each word corresponding to each node.

[0080] The embodiments of the present application are not particularly limited to the implementation method of obtaining a word sequence through a word segmenter, and can be implemented using any existing or future word segmentation algorithm. Correspondingly, the embodiments of the present application are not particularly limited to the implementation method of obtaining a word embedding vector through the embedding layer of a large language model, and can be implemented using any existing or future embedding vector acquisition algorithm.

[0081] Step 25: Calculate the embedding vector of each word corresponding to each node using the TF-IDF algorithm to obtain the semantic embedding of each node.

[0082] In the embodiment of the present application, in order to make the semantic embedding of each node have rich semantics, different weighted aggregation methods can be used to perform weighted summation on the word embedding vectors. Accordingly, in the specific implementation, the TF-IDF algorithm can be further used to measure the importance of each word in the document, thereby helping the generated node semantic embedding to accurately capture the semantic information of the text. Specifically, the process of calculating the semantic embedding using the TF-IDF algorithm can be shown in the following formulas (3-1), (3-2) and (3-3):

[0083] (3-1)

[0084] (3-2)

[0085] , (3-3)

[0086] in, is the semantic embedding of node i, is the embedding vector of the nth word of node i, For entry , For entry In the documentation The number of times it appears in For Documents The number of all entries in For entry In the documentation The inverse text frequency index, is the number of all documents, To include terms The number of documents.

[0087] Step 26: Perform graph encoding on the semantic embedding of each node to obtain the semantically aware representation of each node.

[0088] Here, the graph encoding process can be implemented through a graph encoder module, where the graph encoder module can be implemented using different graph neural networks, such as multi-layer graph convolutional networks or graph attention networks. In this way, by aggregating neighbor information layer by layer through the graph encoder, the complex relationships and structural information in the graph data can be captured.

[0089] In specific implementations, a multi-layer graph convolutional network can be used to extract the structured information of each node. In each layer, the multi-layer graph convolutional network aggregates the information of neighboring nodes through graph convolution operations, thereby gradually enhancing the expressive power of node features. For ease of understanding, the following describes the process of graph encoding the semantic embedding of each node in combination with formula (4):

[0090] (4)

[0091] in, is the semantic-aware representation of node i, is the feature vector of node i in layer l, is the set of neighbor nodes of node i, is the normalization coefficient, is the trainable parameter of layer l.

[0092] S103: Fusing the topology-aware graph representation of each node with the semantic-aware representation of each node to obtain an enhanced feature representation of each node.

[0093] Here, combined Figure 2 As shown, the topological perception graph representation of each node and the semantic perception representation of each node can be fused through the feature fusion module. Accordingly, the embodiment of the present application does not specifically limit the implementation method of the feature fusion module, and can be implemented using any existing or future feature fusion algorithm.

[0094] In this way, the outputs of the topology-aware graph representation module and the graph encoder module can be fused, so that text information can be effectively combined with graph structure information, thereby generating an enhanced feature representation for each node, providing strong feature support for cross-domain node classification tasks.

[0095] S104: Classify the enhanced feature representation of each node using the large language model to obtain a classification result for each node.

[0096] In an embodiment of the present application, after obtaining a large language model that can accurately classify each node, since the enhanced feature representation of each node is a feature aligned with the graph and language space, each node can be accurately classified through the large language model, reflecting the model's powerful generalization ability and accuracy.

[0097] Accordingly, during the training of a large language model, the similarity between graph embeddings and text embeddings can be maximized through self-supervised contrastive learning alignment, thereby achieving effective alignment between the graph and language space. To facilitate understanding, the process of obtaining a large language model is first illustrated. As an example, a large language model can be obtained through the following steps 41-43:

[0098] Step 41: Obtain the true classification results, graph embedding matrix, text embedding matrix and summary embedding matrix corresponding to the training text attribute graph.

[0099] Here, the training text attribute graph, as training data for the large language model, can be pre-stored in a corresponding database. When executing the model training task, the training text attribute graph and the actual classification results corresponding to the training text attribute graph are obtained from the database.

[0100] Accordingly, this solution can design three contrastive learning strategies to maximize the similarity between graph embeddings and text embeddings, graph embeddings and summary embeddings, and text embeddings and summary embeddings, respectively. Thus, in practical applications, after obtaining the training text attribute graph, the graph embedding matrix S, text embedding matrix E, and summary embedding matrix Q corresponding to the training text attribute graph can be defined accordingly.

[0101] Step 42: Based on the graph embedding matrix, the text embedding matrix, and the summary embedding matrix, determine a first similarity between the graph embedding matrix and the text embedding matrix, a second similarity between the graph embedding matrix and the summary embedding matrix, and a third similarity between the text embedding matrix and the summary embedding matrix.

[0102] As an example, the similarity between the three matrices mentioned above can be represented by the corresponding cosine similarity matrix. That is, the cosine similarity matrix can indicate the similarity between the corresponding matrices.

[0103] Based on this, in an embodiment of the present application, a first cosine similarity matrix between the graph embedding matrix and the text embedding matrix can be calculated based on the graph embedding matrix and the text embedding matrix; a second cosine similarity matrix between the graph embedding matrix and the summary embedding matrix can be calculated based on the graph embedding matrix and the summary embedding matrix; and a third cosine similarity matrix between the text embedding matrix and the summary embedding matrix can be calculated based on the text embedding matrix and the summary embedding matrix. The first cosine similarity matrix is ​​used to indicate the first similarity, the second cosine similarity matrix is ​​used to indicate the second similarity, and the third cosine similarity matrix is ​​used to indicate the third similarity.

[0104] Accordingly, the embodiment of the present application may not specifically limit the method for calculating the cosine similarity matrix, and may be implemented using any existing or future matrix calculation algorithm.

[0105] Step 43: Model training is performed based on the first similarity, the second similarity, the third similarity and the actual classification result, and a large language model is obtained after the training is completed.

[0106] In practical applications, the optimization of large language model parameters can be achieved through loss functions, such as the cross-entropy loss function. The cross-entropy loss function performs well in classification problems, effectively reflecting the difference between predicted and true values, thereby helping the model to accurately classify. Furthermore, the cross-entropy loss function converges faster, thus shortening model training time.

[0107] Based on this, during the model training process, first, in combination with the following formula (5), the first loss value can be determined based on the first cosine similarity matrix and the actual classification result through the cross entropy loss function.

[0108] (5)

[0109] in, is the first loss value, CE is the cross entropy loss function, is the first cosine similarity matrix, is the true classification result, and T represents transposition.

[0110] At the same time, combined with the following formula (6), the second loss value can be determined based on the second cosine similarity matrix and the true classification result through the cross entropy loss function.

[0111] (6)

[0112] in, is the second loss value, CE is the cross entropy loss function, is the second cosine similarity matrix, is the true classification result, and T represents transposition.

[0113] Furthermore, as shown in the following formula (7), the third loss value can be determined based on the third cosine similarity matrix and the true classification result through the cross entropy loss function.

[0114] (7)

[0115] in, are three loss values, CE is the cross entropy loss function, is the third cosine similarity matrix, is the true classification result, and T represents transposition.

[0116] Finally, the model training can be performed based on the first loss value, the second loss value, and the third loss value, and a large language model is obtained after the training is completed.

[0117] This self-supervised contrastive learning alignment approach not only enhances the model's ability to jointly understand graph and text data, but also maintains the zero-shot generalization capabilities of large language models. This contrastive learning mechanism ensures that the model can transfer knowledge between different domains, improving its generalization and adaptability in cross-domain tasks.

[0118] It can be seen that based on the relevant contents of the above steps S101 to S104, in an embodiment of the present application, after obtaining a text attribute graph to be processed including a plurality of nodes, topological perception graph processing can be performed on each of the plurality of nodes to obtain a topological perception graph representation of each node, and semantic perception processing can be performed on each node to obtain a semantic perception representation of each node. Then, the topological perception graph representation of each node and the semantic perception representation of each node can be fused to obtain an enhanced feature representation of each node, and the enhanced feature representation of each node can be classified by a large language model to obtain a classification result for each node. It can be seen that through topological perception graph processing, the topological relationship of the graph data can be captured and each node can be mapped to a unified latent space; through semantic perception processing, the text information related to the nodes in the graph can be captured to generate a semantic perception representation that can reflect the semantics of the text. In this way, the enhanced feature representation obtained by fusing the topological-aware graph representation and the semantic-aware representation is a representation with spatial consistency. Therefore, it can achieve alignment between the graph and the language space, thereby effectively solving the spatial alignment problem, enabling the model to achieve stronger generalization capabilities between different fields, and thus obtain accurate classification results in cross-domain node classification tasks.

[0119] Furthermore, based on the node classification method provided in the above embodiment, the embodiment of the present application can also provide a node classification device. The node classification device is described below in conjunction with the embodiments and drawings.

[0120] Figure 4 This is a schematic diagram of the structure of a node classification device provided in an embodiment of the present application. Figure 4 As shown, the node classification device 400 provided in the embodiment of the present application may include:

[0121] A data acquisition module 401 is used to acquire a text attribute graph to be processed, wherein the text attribute graph includes a plurality of nodes;

[0122] A perception processing module 402 is configured to perform topological perception graph processing on each of the plurality of nodes to obtain a topological perception graph representation of each node, and to perform semantic perception processing on each node to obtain a semantic perception representation of each node, wherein the topological perception graph representation is used to map each node to a unified latent space;

[0123] A fusion processing module 403 is configured to fuse the topology-aware graph representation of each node with the semantic-aware representation of each node to obtain an enhanced feature representation of each node;

[0124] The node classification module 404 is configured to classify the enhanced feature representation of each node using a large language model to obtain a classification result for each node.

[0125] Optionally, the perception processing module 402 is specifically configured to:

[0126] Processing the text attribute graph to obtain a first adjacency matrix corresponding to the text attribute graph;

[0127] Performing Laplace normalization on the first adjacency matrix to obtain a second adjacency matrix;

[0128] Performing singular value decomposition on the second adjacency matrix to obtain a topology-aware graph representation of each node.

[0129] Optionally, the perception processing module 402 specifically includes:

[0130] In the text information processing module, Yang Hongyu processes the text information corresponding to each node to obtain the embedding vector of each word corresponding to each node;

[0131] An embedding vector calculation module is used to calculate the embedding vector of each word corresponding to each node by using a word frequency inverse document frequency algorithm to obtain the semantic embedding of each node;

[0132] The graph coding processing module is used to perform graph coding processing on the semantic embedding of each node to obtain a semantically perceived representation of each node.

[0133] Optionally, the embedding vector calculation module is specifically used to:

[0134] Converting the text information corresponding to each node into a word sequence corresponding to each node through the word segmenter of the large language model;

[0135] The word sequence corresponding to each node is processed through the embedding layer of the large language module to obtain an embedding vector for each word corresponding to each node.

[0136] Optionally, the large language model is obtained through the following modules:

[0137] The training data acquisition module is used to obtain the true classification results, graph embedding matrix, text embedding matrix and summary embedding matrix corresponding to the training text attribute graph;

[0138] a similarity determination module configured to determine, based on the graph embedding matrix, the text embedding matrix, and the abstract embedding matrix, a first similarity between the graph embedding matrix and the text embedding matrix, a second similarity between the graph embedding matrix and the abstract embedding matrix, and a third similarity between the text embedding matrix and the abstract embedding matrix;

[0139] A model training module is used to perform model training based on the first similarity, the second similarity, the third similarity and the true classification result, and obtain the large language model after the training is completed.

[0140] Optionally, the similarity determination module is specifically configured to:

[0141] Calculating a first cosine similarity matrix between the graph embedding matrix and the text embedding matrix based on the graph embedding matrix and the text embedding matrix, wherein the first cosine similarity matrix is ​​used to indicate the first similarity;

[0142] calculating, based on the graph embedding matrix and the summary embedding matrix, a second cosine similarity matrix between the graph embedding matrix and the summary embedding matrix, wherein the second cosine similarity matrix is ​​used to indicate the second similarity;

[0143] Based on the text embedding matrix and the summary embedding matrix, a third cosine similarity matrix is ​​calculated between the text embedding matrix and the summary embedding matrix, where the third cosine similarity matrix is ​​used to indicate the third similarity.

[0144] Optionally, the model training module is specifically used to:

[0145] Determining a first loss value based on the first cosine similarity matrix and the true classification result through a cross entropy loss function;

[0146] Determining a second loss value based on the second cosine similarity matrix and the true classification result by using the cross entropy loss function;

[0147] Determining a third loss value based on the third cosine similarity matrix and the true classification result by using the cross entropy loss function;

[0148] Model training is performed based on the first loss value, the second loss value, and the third loss value, and the large language model is obtained after the training is completed.

[0149] Furthermore, an embodiment of the present application also provides an electronic device, comprising: a processor, a memory, and a system bus;

[0150] The processor and the memory are connected via the system bus;

[0151] The memory is used to store one or more programs, and the one or more programs include instructions. When the instructions are executed by the processor, the processor executes any implementation step of the above-mentioned node classification method.

[0152] Furthermore, an embodiment of the present application also provides a computer-readable storage medium, in which instructions are stored. When the instructions are executed on an electronic device, any step of the above-mentioned node classification method is implemented.

[0153] It can be seen from the description of the above implementation methods that those skilled in the art can clearly understand that all or part of the steps in the above-mentioned embodiment methods can be implemented by means of software plus the necessary general hardware platform. Based on this understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. The computer software product can be stored in a storage medium, such as ROM / RAM, a disk, an optical disk, etc., and includes a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network communication device such as a media gateway, etc.) to execute the methods described in each embodiment of the present application or certain parts of the embodiments. It should be noted that the various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same and similar parts between the various embodiments can be referred to each other.

[0154] As for the system disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the description of the method part.

[0155] It should also be noted that, in this document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article, or device comprising the element.

[0156] The above description of the disclosed embodiments is intended to enable one skilled in the art to implement or use the present application. Various modifications to these embodiments will be readily apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application is not limited to the embodiments shown herein, but is intended to conform to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A node classification method, characterized in that: include: Obtaining a text attribute graph to be processed, wherein the text attribute graph includes a plurality of nodes; performing topology-aware graph processing on each of the plurality of nodes to obtain a topology-aware graph representation of each node, and performing semantic-aware processing on each node to obtain a semantic-aware representation of each node, wherein the topology-aware graph representation is used to map each node to a unified latent space; Fusing the topological perception graph representation of each node and the semantic perception representation of each node to obtain an enhanced feature representation of each node; The enhanced feature representation of each node is classified by a large language model to obtain a classification result of each node.

2. The node classification method according to claim 1, characterized in that: The performing topology perception graph processing on each of the plurality of nodes to obtain a topology perception graph representation of each node includes: Processing the text attribute graph to obtain a first adjacency matrix corresponding to the text attribute graph; Performing Laplace normalization on the first adjacency matrix to obtain a second adjacency matrix; Performing singular value decomposition on the second adjacency matrix to obtain a topology-aware graph representation of each node.

3. The node classification method according to claim 1, characterized in that: The performing semantic perception processing on each node to obtain a semantic perception representation of each node includes: Processing the text information corresponding to each node to obtain an embedding vector for each word corresponding to each node; Calculate the embedding vector of each word corresponding to each node by using the word frequency inverse document frequency algorithm to obtain the semantic embedding of each node; Graph encoding is performed on the semantic embedding of each node to obtain a semantically perceptual representation of each node.

4. The node classification method according to claim 3, characterized in that: The processing of the text information corresponding to each node to obtain the embedding vector of each word corresponding to each node includes: Converting the text information corresponding to each node into a word sequence corresponding to each node through the word segmenter of the large language model; The word sequence corresponding to each node is processed through the embedding layer of the large language module to obtain an embedding vector for each word corresponding to each node.

5. The node classification method according to any one of claims 1 to 4, characterized in that: The large language model is obtained through the following steps: Obtain the true classification results, graph embedding matrix, text embedding matrix, and summary embedding matrix corresponding to the training text attribute graph; Based on the graph embedding matrix, the text embedding matrix, and the summary embedding matrix, determining a first similarity between the graph embedding matrix and the text embedding matrix, a second similarity between the graph embedding matrix and the summary embedding matrix, and a third similarity between the text embedding matrix and the summary embedding matrix; Model training is performed based on the first similarity, the second similarity, the third similarity and the true classification result, and the large language model is obtained after the training is completed.

6. The node classification method according to claim 5, characterized in that: The determining, based on the graph embedding matrix, the text embedding matrix, and the summary embedding matrix, a first similarity between the graph embedding matrix and the text embedding matrix, a second similarity between the graph embedding matrix and the summary embedding matrix, and a third similarity between the text embedding matrix and the summary embedding matrix comprises: Calculating a first cosine similarity matrix between the graph embedding matrix and the text embedding matrix based on the graph embedding matrix and the text embedding matrix, wherein the first cosine similarity matrix is ​​used to indicate the first similarity; calculating, based on the graph embedding matrix and the summary embedding matrix, a second cosine similarity matrix between the graph embedding matrix and the summary embedding matrix, wherein the second cosine similarity matrix is ​​used to indicate the second similarity; Based on the text embedding matrix and the summary embedding matrix, a third cosine similarity matrix is ​​calculated between the text embedding matrix and the summary embedding matrix, where the third cosine similarity matrix is ​​used to indicate the third similarity.

7. The node classification method according to claim 6, characterized in that: The performing of model training based on the first similarity, the second similarity, the third similarity, and the true classification result, and obtaining the large language model after the training, includes: Determining a first loss value based on the first cosine similarity matrix and the true classification result through a cross entropy loss function; Determining a second loss value based on the second cosine similarity matrix and the true classification result by using the cross entropy loss function; Determining a third loss value based on the third cosine similarity matrix and the true classification result by using the cross entropy loss function; Model training is performed based on the first loss value, the second loss value, and the third loss value, and the large language model is obtained after the training is completed.

8. A node classification device, characterized in that: include: A data acquisition module, configured to acquire a text attribute graph to be processed, wherein the text attribute graph includes a plurality of nodes; a perception processing module, configured to perform topological perception graph processing on each of the plurality of nodes to obtain a topological perception graph representation of each node, and to perform semantic perception processing on each node to obtain a semantic perception representation of each node, wherein the topological perception graph representation is used to map each node to a unified latent space; A fusion processing module, configured to fuse the topological perception graph representation of each node and the semantic perception representation of each node to obtain an enhanced feature representation of each node; The node classification module is used to classify the enhanced feature representation of each node through a large language model to obtain a classification result of each node.

9. An electronic device, characterized in that: The device includes: a processor, a memory, and a system bus; The processor and the memory are connected via the system bus; The memory is used to store a program, wherein the program includes instructions, and when the instructions are executed by the processor, the processor executes the steps of the node classification method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the node classification method according to any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Chemical preparation field long text classification method based on graph neural network

    CN114218389A

  • Financial risk early warning method and device based on knowledge graph

    CN114282003A

  • Text classification method and device, equipment and storage medium

    CN118568257A

  • Relation extraction method and device based on entity pair and shortest dependency path

    CN118821779A