Node classification method, device, terminal and medium based on multi-level semantic information representation of heterogeneous knowledge graph
By extracting the semantic information of the node level, path level and category level in the heterogeneous knowledge map, generate a multi -level semantic information representation, solve the problem that the existing technology cannot fully extract the complex semantic information of the heterogeneous diagram, and improve the node classification. accuracy.
Patent Information
- Application Number
- CN202410442358.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-12
- Publication Date
- 2025-01-21
- Estimated Expiration
- 2044-04-12
AI Technical Summary
The prior art cannot fully identify and extract complex semantic information in heterogeneous graphs, resulting in low quality of node representation, affecting the accuracy of downstream node classification tasks.
By obtaining heterogeneous knowledge graph data sets and presetting multiple meta-paths, semantic information extraction processing at the node level and path level is performed respectively, and combined with semantic information extraction processing at the category level, multi-level semantic information representation of each node is generated.
The path information aggregation mechanism is enhanced, the inherent semantic information related to meta-paths is captured, the accuracy and robustness of the node classification process are improved, and the complex semantic information in the heterogeneous knowledge graph is fully utilized.
Smart Images

Figure CN118171205B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of machine learning technology, and in particular to a node classification method, device, terminal and medium based on multi-level semantic information representation of heterogeneous knowledge graphs. Background Art
[0002] Heterogeneous graphs have attracted attention because they can accurately represent complex semantic relationships in the real world. Compared with traditional homogeneous graphs, heterogeneous graphs contain multiple types of nodes and edges, so they can more comprehensively capture the multi-dimensional relationships between data. In recent years, graph neural networks (GNNs) have been widely used in node representation learning of heterogeneous graphs, and have achieved remarkable progress and results. The semantic information in heterogeneous knowledge graphs is divided into three levels, namely the node level, the path level, and the category level. At present, existing technologies generally innovate in graph learning and node representation in terms of paths. For example, a classic method is MAGNN-AC, which first uses existing heterogeneous network embedding methods to learn node embeddings, and then uses the topological structure of the graph as a guide to predict the properties of the target node by inheriting the properties of neighboring nodes and combining attention operations.
[0003] However, existing methods rarely extract or characterize heterogeneous knowledge graphs from three levels. For example, RWNN (Relational Walk Neural Network) and MAGNN (Metapath Aggregated Graph Neural Network) only use path information. LEGNN (Label-Enhanced Graph Neural Network) uses label information but ignores the semantics in the path.
[0004] More importantly, even algorithms that focus on extracting semantic information at one level fail to fully utilize the semantic information that can be provided by that level. For semantic information at the node level, methods in the prior art, such as TransE (Translating Embeddings for Modeling Multi-relational Data), treat nodes in the path as independent units, while ignoring the interactions between nodes. For semantic information at the path level, methods in the prior art usually generate path-level semantics by aggregating the searched paths or meta-path instances. For example, RWNN causes confusion in the acquired semantic information; meta-path captures semantic information at the path level (HAN) only uses meta-paths to search for nodes of the same category, while ignoring the information that can be provided by other nodes on the path and the semantic information of the meta-path itself. For semantics at the category level, insufficient use of category label semantics may lead to category semantic bias problems. Even the prior art method of adding category labels as nodes to the knowledge graph for graph propagation (LEGNN) still has the problem of insufficient category label generation. At the same time, using only one label may also lead to classification bias.
[0005] It can be seen that one problem faced by the methods in the prior art is that they are unable to fully identify and extract complex semantic information in heterogeneous graphs, resulting in low quality of final node representation, which affects the accuracy of downstream node classification tasks. Summary of the invention
[0006] In view of the shortcomings of the prior art mentioned above, the purpose of the present application is to provide a node classification method, device, terminal and medium based on multi-level semantic information representation of heterogeneous knowledge graphs, so as to solve the problem that the prior art cannot fully identify and extract complex semantic information in heterogeneous graphs, and the quality of the final node representation is low, thereby affecting the accuracy of downstream node classification tasks.
[0007] To achieve the above-mentioned purpose and other related purposes, the first aspect of the present application provides a node classification method based on multi-level semantic information representation of heterogeneous knowledge graphs, including: obtaining a heterogeneous knowledge graph dataset to be classified and presetting multiple meta-paths; wherein the heterogeneous knowledge graph dataset to be classified includes multiple nodes; the types of nodes include: nodes with subcategory labels and nodes without subcategory labels; according to the preset multiple meta-paths, performing node-level semantic information extraction processing and path-level semantic information extraction processing on the heterogeneous knowledge graph dataset to be classified, respectively, to obtain node representation information of each node; based on the obtained node representation information of each node, performing category-level semantic information extraction processing on the heterogeneous knowledge graph dataset to be classified, to obtain a subcategory classification result for each node without a subcategory label.
[0008] In some embodiments of the first aspect of the present application, according to a preset plurality of meta-paths, the heterogeneous knowledge graph dataset to be classified is subjected to node-level semantic information extraction processing and path-level semantic information extraction processing respectively to obtain node representation information of each node, including: according to a preset plurality of meta-paths, the heterogeneous knowledge graph dataset to be classified is subjected to node-level semantic information extraction processing to obtain node-level semantic information of each node under each meta-path; according to a preset plurality of meta-paths, the heterogeneous knowledge graph dataset to be classified is subjected to path-level semantic information extraction processing to obtain path-level semantic information of each node under each meta-path; the node-level semantic information and path-level semantic information of each node under each meta-path are superimposed to obtain the node semantic information of each node under each meta-path; the node semantic information of each node under each meta-path is superimposed to obtain the node representation information of each node.
[0009] In some embodiments of the first aspect of the present application, according to a preset plurality of meta-paths, the heterogeneous knowledge graph dataset to be classified is subjected to node-level semantic information extraction processing to obtain node-level semantic information of each node under each meta-path, including: according to the preset plurality of meta-paths and each node, a search is performed in the heterogeneous knowledge graph dataset to obtain a plurality of meta-path instances of each node under each meta-path; based on the plurality of meta-path instances of each node under each meta-path, single-node-level instance representation information and double-node-level instance representation information corresponding to each meta-path instance of each node under each meta-path are obtained by performing single-node aggregation processing and double-node aggregation processing on the meta-path instances, and the two are added to obtain the node instance representation information corresponding to each meta-path instance of each node under each meta-path; based on the node instance representation information corresponding to each meta-path instance of each node under each meta-path, node-level semantic information of each node under each meta-path is generated by weighting processing.
[0010] In some embodiments of the first aspect of the present application, each node also has a main category label; wherein each subcategory label is associated with a main category label.
[0011] In some embodiments of the first aspect of the present application, path-level semantic information extraction processing is performed on the heterogeneous knowledge graph dataset to be classified according to a preset plurality of meta-paths to obtain path-level semantic information of each node under each meta-path, including: obtaining a subgraph of each node under each meta-path from the heterogeneous knowledge graph dataset to be classified according to the preset plurality of meta-paths and each node; performing a node superposition operation with the same number of hops on the subgraph of each node under each meta-path to obtain path-level semantic information of each node under each meta-path; wherein nodes with the same number of hops have the same main category label.
[0012] In some embodiments of the first aspect of the present application, based on the node representation information of each node obtained, the heterogeneous knowledge graph dataset to be classified is subjected to category-level semantic information extraction processing to obtain the subcategory classification result of each node without a subcategory label, including: according to each subcategory label, the nodes with subcategory labels in the heterogeneous knowledge graph dataset to be classified are screened for subcategory labels to obtain a node set for each subcategory label; utilizing degree centrality to determine a core node set for each subcategory label from the node set for each subcategory label by sorting by the shortest path length; based on the core node set of each subcategory label, multiple rounds of node classification operations are performed to obtain multiple rounds of subcategory classification results for each node without a subcategory label; and statistics are performed on the multiple rounds of subcategory classification results for each node without a subcategory label to obtain the final subcategory classification result for each node without a subcategory label.
[0013] In some embodiments of the first aspect of the present application, each round of node classification operation includes: determining the central node corresponding to each subcategory label in this round from the core node set of each subcategory label; based on the central node corresponding to each subcategory label determined in this round, generating the category label representation information corresponding to each subcategory label in this round through a central projection operation based on the node representation information; inputting the category label representation information corresponding to each subcategory label in this round into the heterogeneous knowledge graph dataset of this round, and updating the heterogeneous knowledge graph dataset of this round using GNN; outputting the updated heterogeneous knowledge graph dataset as the heterogeneous knowledge graph dataset corresponding to the next round; based on the updated heterogeneous knowledge graph dataset, by executing the node classification task of this round, obtaining the subcategory classification result of each node without subcategory label in this round.
[0014] To achieve the above-mentioned purpose and other related purposes, the second aspect of the present application provides a node classification device based on multi-level semantic information representation of heterogeneous knowledge graphs, including: an acquisition module, used to acquire a heterogeneous knowledge graph dataset to be classified and preset multiple meta-paths; wherein the heterogeneous knowledge graph dataset to be classified includes multiple nodes; the types of nodes include: nodes with subcategory labels and nodes without subcategory labels; a node representation information generation module, connected to the acquisition module, used to perform node-level semantic information extraction processing and path-level semantic information extraction processing on the heterogeneous knowledge graph dataset to be classified according to the preset multiple meta-paths, so as to obtain node representation information of each node; a node classification module, connected to the node representation information generation module, used to perform category-level semantic information extraction processing on the heterogeneous knowledge graph dataset to be classified based on the obtained node representation information of each node, and obtain subcategory classification results for each node without a subcategory label.
[0015] To achieve the above-mentioned purpose and other related purposes, the third aspect of the present application provides an electronic terminal, including: a processor and a memory; the memory is used to store computer programs, and the processor is used to execute the computer programs stored in the memory, so that the terminal executes the node classification method based on multi-level semantic information representation of heterogeneous knowledge graphs.
[0016] To achieve the above-mentioned purpose and other related purposes, the fourth aspect of the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the node classification method based on multi-level semantic information representation of heterogeneous knowledge graphs.
[0017] As described above, the node classification method, device, terminal and medium based on heterogeneous knowledge graph multi-level semantic information representation of the present application have the following beneficial effects:
[0018] The present application enhances the existing path information aggregation mechanism through node-level semantic information extraction and processing, captures the inherent semantic information related to the meta-path through path-level semantic information extraction and processing, and improves the accuracy and robustness of the node classification process through category-level semantic information extraction and processing, making full use of the complex semantic information in heterogeneous knowledge graphs. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] Figure 1 Shown is a flowchart of a node classification method based on multi-level semantic information representation of heterogeneous knowledge graphs in one embodiment of the present application.
[0020] Figure 2 Shown is a flowchart of a method for obtaining node representation information in one embodiment of the present application.
[0021] Figure 3 Shown is a schematic diagram of the structure of a sub-diagram in a specific embodiment of the present application.
[0022] Figure 4 Shown is a flowchart of semantic information extraction processing at the category level in one embodiment of the present application.
[0023] Figure 5 Shown is a structural schematic diagram of a node classification device based on multi-level semantic information representation of a heterogeneous knowledge graph in one embodiment of the present application.
[0024] Figure 6 Shown is a schematic diagram of the structure of an electronic terminal in one embodiment of the present application. DETAILED DESCRIPTION
[0025] The following describes the embodiments of the present application through specific examples, and those skilled in the art can easily understand other advantages and effects of the present application from the contents disclosed in this specification. The present application can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present application. It should be noted that the following embodiments and features in the embodiments can be combined with each other without conflict.
[0026] It should be noted that in the following description, with reference to the accompanying drawings, several embodiments of the present application are described in the accompanying drawings. It should be understood that other embodiments may also be used, and mechanical composition, structure, electrical and operational changes may be made without departing from the spirit and scope of the present application. The following detailed description should not be considered restrictive, and the scope of the embodiments of the present application is limited only by the claims of the published patents. The terms used here are only for describing specific embodiments and are not intended to limit the present application. Spatially related terms, such as "upper", "lower", "left", "right", "below", "below", "lower", "above", "upper", etc., may be used in the text to facilitate the description of the relationship between an element or feature shown in the figure and another element or feature.
[0027] In this application, unless otherwise clearly specified and limited, the terms "install", "connect", "connect", "fix", "hold" and the like should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be an indirect connection through an intermediate medium, or it can be the internal communication of two components. For ordinary technicians in this field, the specific meanings of the above terms in this application can be understood according to specific circumstances.
[0028] Furthermore, as used herein, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless the context indicates otherwise. The terms "first", "second", "third", "fourth", etc. (if any) in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments described here can be implemented in an order other than that illustrated or described here. In addition, the terms "comprising" and "including" indicate the presence of the described features, operations, elements, components, items, kinds, and / or groups, but do not exclude the presence, occurrence or addition of one or more other features, operations, elements, components, items, kinds, and / or groups. It should be further understood that the terms "or" and "and / or" used herein are interpreted as inclusive, or mean any one or any combination. Therefore, "A, B or C" or "A, B and / or C" means "any of the following: A; B; C; A and B; A and C; B and C; A, B and C". Exceptions to this definition occur only when a combination of elements, functions, or operations are inherently mutually exclusive in some manner.
[0029] The present application provides a node classification method, device, terminal and medium based on multi-level semantic information representation of heterogeneous knowledge graphs. According to multiple preset meta-paths, semantic information extraction processing is performed on the heterogeneous knowledge graph data set to be classified at the node level and semantic information extraction processing is performed on the path level, and then semantic information extraction processing is performed on the heterogeneous knowledge graph data set to be classified at the category level to obtain the sub-classification results of each node that does not have a sub-category label in the heterogeneous knowledge graph data set to be classified. The present application enhances the existing path information aggregation mechanism through node-level semantic information extraction processing, captures the inherent semantic information related to the meta-path through path-level semantic information extraction processing, and improves the accuracy and robustness of the node classification process through category-level semantic information extraction processing, and makes full use of the complex semantic information in the heterogeneous knowledge graph. Before further explaining the present invention in detail, the nouns and terms involved in the embodiments of the present invention are explained. The nouns and terms involved in the embodiments of the present invention are applicable to the following explanations:
[0030] (1) Meta-path: A meta-path is a special kind of path that defines a connection pattern through a specific sequence of entities and relationships. Specifically, a meta-path is a high-level, type-based path. It does not refer to a specific entity or relationship in the graph, but to a sequence of entity types and relationship types. For example, in a knowledge graph containing "author", "book", and "publisher", a meta-path can be "author-writing-book-publishing-publisher". This meta-path represents a relationship path between "author" and "publisher".
[0031] (2) Meta-path instance: A meta-path instance refers to a path instance that actually exists in a specific knowledge graph or network according to a certain meta-path pattern. A meta-path is a high-level pattern that describes a way of connecting different types of nodes and edges, while a meta-path instance is the specific manifestation of this pattern in specific data. Taking a simple academic network as an example, assume that there are three types of entities: researchers (R), papers (P), and research fields (F). In this network, a meta-path can be defined: researchers-writing-papers-involving-research fields (RPF). This meta-path represents the relationship between researchers and research fields through writing papers.
[0032] (3) LSTM (Long Short-Term Memory) Network: LSTM is a special type of recurrent neural network (RNN). It is designed to process sequence data and is more effective than traditional RNN in handling long-term dependencies. The key feature of LSTM is its internal structure, which consists of three gates (gated cells): input gate, forget gate, and output gate. These gates control the flow of information between cells, allowing LSTM to retain long-term information while forgetting irrelevant information.
[0033] (4) k-hop subgraph: A k-hop subgraph is a subgraph consisting of nodes and edges that can be reached from a given starting node after at most k steps (or "hops"). Specifically, a k-hop subgraph includes all nodes that can be reached from the starting node after no more than k edge traversals, as well as all edges between these nodes.
[0034] (5) GNN (Graph Neural Network): GNN is a neural network specifically designed to process graph-structured data. The core idea of GNN is to learn the representation (embedding) of a node through the features of the node and the features of its neighboring nodes. This process usually involves the following steps: Aggregate neighbor information: For each node, GNN will collect information about its neighboring nodes. This is usually achieved through some form of "aggregation function" such as sum, average, or maximum. Update node representation: GNN then uses the aggregated neighbor information and the node's own features to update the representation of the node. This update process is usually implemented through a neural network layer (such as a fully connected layer). Repeated iteration: This process can be repeated multiple times, and each iteration may involve different aggregation and update steps to capture a wider range of neighbor information.
[0035] (6) Degree centrality: Degree centrality is an important concept in network analysis, which is used to measure the importance of nodes in the network. In graph theory and complex networks, degree centrality is the number of neighbors of a node, that is, the number of other nodes directly connected to the node.
[0036] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the technical solution in the embodiments of the present invention is further described in detail through the following embodiments and in combination with the accompanying drawings. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the invention.
[0037] like Figure 1 As shown, a flow chart of a node classification method based on multi-level semantic information representation of heterogeneous knowledge graphs in an embodiment of the present invention is presented.
[0038] The node classification method based on multi-level semantic information representation of heterogeneous knowledge graph includes:
[0039] Step S101: Obtain a heterogeneous knowledge graph dataset to be classified and preset multiple meta-paths.
[0040] In one embodiment, the heterogeneous knowledge graph data set to be classified includes a node set; the node set includes multiple nodes; the types of nodes include: nodes with subcategory labels and nodes without subcategory labels.
[0041] In one embodiment, each node also has a main category label; wherein each subcategory label is associated with a main category label.
[0042] Specifically, all nodes in the heterogeneous knowledge graph dataset to be classified have a main category label, some nodes in the heterogeneous knowledge graph dataset to be classified have subcategory labels, and the rest of the nodes do not have subcategory labels. Each subcategory label is associated with a main category label.
[0043] For example, the main category labels of a heterogeneous knowledge graph dataset to be classified include: researchers, papers, and research fields; the subcategory labels include: professors, students, papers in journal 1, papers in journal 2, biology, and physics. The subcategory labels of type professors and students are associated with the main category label of type researchers; the subcategory labels of types papers in journal 1 and papers in journal 2 are associated with the main category label of type papers; the subcategory labels of types biology and physics are associated with the main category label of type research fields.
[0044] It should be noted that the preset multiple meta-paths are related to the types of main category labels in the obtained heterogeneous knowledge graph dataset.
[0045] Step S102: According to the preset multiple meta-paths, the heterogeneous knowledge graph dataset is subjected to node-level semantic information extraction processing and path-level semantic information extraction processing to obtain node representation information of each node under all meta-paths.
[0046] In one embodiment, according to a preset plurality of meta-paths, the heterogeneous knowledge graph dataset to be classified is subjected to node-level semantic information extraction processing and path-level semantic information extraction processing respectively to obtain node representation information of each node, including: according to a preset plurality of meta-paths, the heterogeneous knowledge graph dataset to be classified is subjected to node-level semantic information extraction processing to obtain node-level semantic information of each node under each meta-path; according to a preset plurality of meta-paths, the heterogeneous knowledge graph dataset to be classified is subjected to path-level semantic information extraction processing to obtain path-level semantic information of each node under each meta-path; the node-level semantic information and path-level semantic information of each node under each meta-path are superimposed to obtain the node semantic information of each node under each meta-path; the node semantic information of each node under each meta-path is superimposed to obtain the node representation information of each node.
[0047] In one embodiment, according to a preset plurality of meta-paths, the heterogeneous knowledge graph data set to be classified is subjected to node-level semantic information extraction processing to obtain node-level semantic information of each node under each meta-path, including: according to the preset plurality of meta-paths and each node, a search is performed in the heterogeneous knowledge graph data set to obtain a plurality of meta-path instances of each node under each meta-path; based on the plurality of meta-path instances of each node under each meta-path, single-node-level instance representation information and double-node-level instance representation information corresponding to each meta-path instance of each node under each meta-path are obtained by performing single-node aggregation processing and double-node aggregation processing on the meta-path instances, and the two are added to obtain the node instance representation information corresponding to each meta-path instance of each node under each meta-path; based on the node instance representation information corresponding to each meta-path instance of each node under each meta-path, node-level semantic information of each node under each meta-path is generated by weighting processing.
[0048] In one embodiment, according to a preset plurality of meta-paths, path-level semantic information extraction processing is performed on the heterogeneous knowledge graph dataset to be classified to obtain path-level semantic information of each node under each meta-path, including: according to the preset plurality of meta-paths and each node, a subgraph of each node under each meta-path is obtained from the heterogeneous knowledge graph dataset to be classified; a node superposition operation with the same number of hops is performed on the subgraph of each node under each meta-path to obtain path-level semantic information of each node under each meta-path; wherein nodes with the same number of hops have the same main category label.
[0049] The following will explain in detail the process of extracting semantic information at the node level and the path level:
[0050] The heterogeneous knowledge graph dataset to be classified includes a node set A, and one of the nodes in the node set A is A i ; Wherein, i=1,…,|A|; |A| represents the number of nodes in the node set A.
[0051] The default meta path is P t , all preset meta-paths constitute a meta-path set P; wherein, t=1,…,|P|; |P| represents the number of meta-paths in the meta-path set P.
[0052] In each round, a node in the node set A is specified and a meta-path in the meta-path set P is selected without duplication. The node specified and the meta-path selected in this round are regarded as a node-meta-path combination. The number of node-meta-path combinations is |A|×|P|.
[0053] For Node A i And the metapath P t The specific process of node-level semantic information extraction is as follows: Figure 2 Shown include:
[0054] Step S201: According to node A i And the metapath P t , from A i Start searching in the heterogeneous knowledge graph dataset and get node A i In the metapath P t Multiple meta path instances under .
[0055] Among them, the obtained multiple meta-path instances constitute a meta-path instance set T i,t , T i,t A metapath instance in T k ; where k = 1,…,|T i,t |;T k =A1,A2,A3,…,An-1 ,A n ;|T i,t | is represented as a set of meta-path instances T i,t The number of meta-path instances.
[0056] Step S202: Based on point A i In the metapath P t By performing single-node aggregation on the meta-path instances, node A is obtained. i In the metapath P t Each meta-path instance under the corresponding single-node level instance represents information.
[0057] Specifically, referring to the following formula 1, for node A i In the metapath P t The metapath instance T k Perform single-node aggregation processing. The process of single-node aggregation processing is to convert the meta-path instance T k All nodes in and the relationships connecting each node are concatenated to obtain a sequence, and the obtained sequence is input into the LSTM model to obtain node A. i In the metapath P t The metapath instance T k Corresponding single node level instance representation information
[0058]
[0059] Among them, LSTM() represents the LSTM model, and the concat(·) function represents the concatenation of sequences.
[0060] Step S203: Based on point A i In the metapath P t By performing single-node aggregation on the meta-path instances, node A is obtained. i In the metapath P t Each meta-path instance under the corresponding single-node level instance represents information.
[0061] Specifically, refer to the following formulas 2 to 5 for the meta-path instance T k Perform dual-node aggregation processing. The dual-node aggregation processing process is as follows: for the meta-path instance T k Each node A in m-1 , node A m-1 and A m-1 The next node to connect to is A m The node pairs are formed, and each node pair is weightedly aggregated to obtain the aggregation result. The aggregation result is serialized and input into LSTM to obtain node A.i In the metapath P t The metapath instance T k Corresponding dual-node level instance representation information
[0062] ω m-1 =W m-1 R(A m-1 )+W m R(A m ); (Formula 2)
[0063]
[0064]
[0065]
[0066] Among them, W m-1 and W m is the weight, the deg(·) function is used to calculate the degree of the node, the concat(·) function represents the concatenation of the sequence, ω m-1 Represented as the aggregation result, R(·) is used to convert the description of each node into an initialized vectorized representation that can be used by the model.
[0067] Step S204: Node A i In the metapath P t The single-node level instance representation information and the double-node level instance representation information corresponding to each meta-path instance under are superimposed to obtain node A i In the metapath P t The node instance corresponding to each meta-path instance below represents information.
[0068] Specifically, referring to the following formula 6, for node A i In the metapath P t The metapath instance T k Corresponding single node level instance representation information And dual-node level instance representation information Superposition is performed to obtain node A i In the metapath P t The metapath instance T k The corresponding node instance represents information
[0069]
[0070] Step S205: Based on node A i In the metapath P t Each node instance corresponding to each meta-path instance under represents information, and generates node A through weighting.i In the metapath P t The node set semantic information below.
[0071] Specifically, referring to the following formula 8, calculate node A i In the metapath P t The weight corresponding to each meta path instance below:
[0072]
[0073] in, represents the weight matrix specific to the category a to which node i belongs, which is a learnable parameter. represents the transpose of the matrix, α k Represented as a metapath instance T k The corresponding weight.
[0074] Further, referring to the following formula 9, based on node A i In the metapath P t Each meta-path instance under the node instance represents information and the corresponding weight, and calculates node A i In the metapath P t Node-level semantic information under
[0075]
[0076] Among them, α k Represented as a metapath instance T k The corresponding weights, Represented as a metapath instance T k The corresponding node instance represents the information.
[0077] For Node A i And the metapath P t The specific process of path-level semantic information extraction is as follows: Figure 2 Shown include:
[0078] Step S301: According to node A i And the metapath P t , search in the heterogeneous knowledge graph dataset to be classified and get node A i In the metapath P t The subgraph under (also called a k-hop subgraph, where the value of k is equal to the meta-path P t length).
[0079] It should be noted that the subgraphs obtained by searching can be referred to Figure 3 .
[0080] Step S302: Node A iIn the metapath P t The subgraph below performs node superposition operation with the same number of hops to obtain node A i In the metapath P t Path-level semantic information.
[0081] Specifically, refer to the following formula 10 to obtain node A i In the metapath P t The node superposition results corresponding to each hop in the subgraph below
[0082]
[0083] in, Where c represents the number of hops, H represents the main category label, and j represents the jth node.
[0084] For example, the meta-path is APB (A, P and B are all main category labels) and the number of hops c is defined from left to right of the meta-path as 1, 2, and 3. That is, the main category label of the first hop is A, the main category label of the second hop is P, and the main category label of the third hop is B. The subgraph obtained according to the meta-path APB is Figure 3 As shown, it can be seen that the node superposition result corresponding to the first hop The node superposition result corresponding to the second hop The node superposition result corresponding to the third hop
[0085] Further, referring to the following formula 11, for the obtained node A i In the metapath P t The node superposition results corresponding to all jumps in the subgraph below Perform splicing and input the splicing result into the LSTM model to generate node A i In the metapath P t Path-level semantic information under
[0086]
[0087] Among them, LSTM() represents the LSTM model, and the concat(·) function represents the concatenation of sequences.
[0088] After obtaining node A i In the metapath P t Node-level semantic information under And path-level semantic information Then, refer to the following formula 12, for node A i In the metapath P t Node-level semantic information under And path-level semantic information Superposition is performed to obtain node A i In the metapath P t Node semantic information under
[0089]
[0090] Further, referring to the following formula 13, for node A i The node semantic information under each meta-path is superimposed to obtain node A i The node represents information Z i :
[0091]
[0092] Step S103: Based on the obtained node representation information of each node under all meta-paths, the category-level semantic information extraction processing is performed on the heterogeneous knowledge graph dataset to obtain a sub-classification result for each node that does not have a sub-category label.
[0093] In one embodiment, based on the node representation information of each node obtained, the heterogeneous knowledge graph dataset to be classified is subjected to category-level semantic information extraction processing to obtain the subcategory classification result of each node without a subcategory label, including: according to each subcategory label, the nodes with subcategory labels in the heterogeneous knowledge graph dataset to be classified are screened for subcategory labels to obtain a node set for each subcategory label; utilizing degree centrality, by adopting the shortest path length sorting method, determining the core node set for each subcategory label from the node set for each subcategory label; based on the core node set of each subcategory label, performing multiple rounds of node classification operations to obtain multiple rounds of subcategory classification results for each node without a subcategory label; and performing statistics on the multiple rounds of subcategory classification results for each node without a subcategory label to obtain the final subcategory classification result for each node without a subcategory label.
[0094] In one embodiment, each round of node classification operation includes: determining the central node corresponding to each subcategory label in this round from the core node set of each subcategory label; based on the central node corresponding to each subcategory label determined in this round, generating the category label representation information corresponding to each subcategory label in this round through a central projection operation based on the node representation information; inputting the category label representation information corresponding to each subcategory label in this round into the heterogeneous knowledge graph dataset of this round, and updating the heterogeneous knowledge graph dataset of this round using GNN; outputting the updated heterogeneous knowledge graph dataset as the heterogeneous knowledge graph dataset corresponding to the next round; based on the updated heterogeneous knowledge graph dataset, by executing the node classification task of this round, obtaining the subcategory classification result of each node without subcategory label in this round.
[0095] The following will be combined with the attached Figure 4 , the process of step S103 is explained in detail:
[0096] According to each subcategory label, the nodes with subcategory labels in the heterogeneous knowledge graph dataset to be classified are screened for subcategory labels to obtain a node set of each subcategory label.
[0097] Furthermore, for each subcategory label, the degree centrality is used to select the first n nodes with the highest degree in the node set of the subcategory label; the shortest path length from each of the first n nodes with the highest degree to each of the remaining nodes in the node set of the subcategory label is calculated to calculate the average shortest path length from each of the first n nodes with the highest degree to the node set of the subcategory label.
[0098] For example, for subcategory label a, its node set includes a1, a2, a3, a4, a5, a6 and a7, and the first n nodes with the highest degrees are selected as a1, a4 and a7. For node a1, calculate the shortest path lengths from a1 to a2, a3, a4, a5, a6 and a7 (respectively the shortest path length from a1 to a2, the shortest path length from a1 to a3, the shortest path length from a1 to a4, the shortest path length from a1 to a5, the shortest path length from a1 to a6 and the shortest path length from a1 to a7), and take the average of the shortest path lengths from a1 to a2, a3, a4, a5, a6 and a7, and get the average of the shortest path lengths from a1 to the node set of subcategory label a.
[0099] Furthermore, the average shortest path lengths from each of the first n nodes with the highest degree to the node set of the subcategory label are sorted from small to large, and the first m nodes are output as the core node set corresponding to the subcategory label; wherein, is the floor function.
[0100] It should be noted that the method will select m core nodes for each subcategory label, and the number of core node sets finally obtained is equal to the number of subcategory label types.
[0101] It should also be noted that, considering that the number of nodes corresponding to each subcategory label is inconsistent, the number of nodes corresponding to each subcategory label will be counted first, and n will be set to the number of nodes corresponding to the subcategory label with the smallest number of nodes among all subcategory labels.
[0102] Furthermore, based on the core node set of each subcategory label, multiple rounds of node classification operations are performed to obtain multiple rounds of subcategory classification results for each node without a subcategory label.
[0103] Specifically, Figure 4 As shown, each round of node classification operation specifically includes:
[0104] Step S401: Determine the central node corresponding to each sub-category label in this round from the core node set corresponding to each sub-category label.
[0105] Step S402: Based on the central node corresponding to each sub-category label determined in this round, the category label representation information corresponding to each sub-category label in this round is generated by a central projection operation based on the node representation information.
[0106] Since the category labels corresponding to each subcategory label in this round represent information in the same way, the following explanation is given using a subcategory label C1 as an example:
[0107] The core node set of subcategory label C1 is N1, and the central node determined in this round is A i′ Based on the central node A i′ Perform center projection operation to generate the center node A i′ The corresponding projection information P i,i′ .
[0108] The specific process of the center projection operation includes: Referring to the following formula 14, based on the node representation information Z of each node in the shortest path node set N1 i , by removing the central node A from the shortest path node set N1 i′ Each node outside the i′ Projection method, generate each node at the central node A i′ The projection information P under i,i′ :
[0109]
[0110] Among them, Z i′ The central node Z i′ The nodes represent information, Z i The core node set N1 except the central node A i′ A node other than a node represents information.
[0111] For the core node set N1, except for the central node A i′ Each node other than the central node A i′ The projection information under is superimposed to obtain the category label representation information corresponding to the sub-category label C1 in this round.
[0112] Step S403: Input the category label representation information corresponding to each subcategory label in this round into the heterogeneous knowledge graph dataset of this round, and use GNN to update the heterogeneous knowledge graph dataset of this round.
[0113] Specifically, the category label representation information corresponding to each subcategory label in this round is input into the heterogeneous knowledge graph dataset of this round in the form of a node. After the category label representation information is input, each node with a subcategory label in the heterogeneous knowledge graph dataset is connected to a node with the corresponding category label representation information.
[0114] GNN is used to update the heterogeneous knowledge graph dataset of this round, and the updated heterogeneous knowledge graph dataset is output as the corresponding heterogeneous knowledge graph dataset of the next round. It should be noted that the heterogeneous knowledge graph dataset to be classified is the heterogeneous knowledge graph dataset of the first round.
[0115] Step S404: Based on the updated heterogeneous knowledge graph dataset, by executing the node classification task of this round, the subcategory classification result of each node without a subcategory mark in this round is obtained.
[0116] Specifically, the node classification task includes: calculating the similarity between the information represented by each node without a subcategory label and the category label corresponding to each subcategory label in this round of heterogeneous knowledge graph dataset, and the subcategory label corresponding to the highest similarity is the subcategory classification result of the node without a subcategory label in this round.
[0117] Furthermore, statistics are collected on the results of multiple rounds of subcategory classification for each node without a subcategory label to obtain a final subcategory classification result for each node without a subcategory label.
[0118] For example, the multiple rounds of sub-category classification results of a node without a sub-category label are research field 1, research field 2, research field 1, research field 1, research field 1, research field 3, and research field 1. According to statistics, the sub-category classification result of research field 1 appears the most times, so the final sub-category classification result of the node without a sub-category label is research field 1.
[0119] Similar to the above-mentioned embodiment, the present invention also provides a node classification device based on multi-level semantic information representation of heterogeneous knowledge graphs.
[0120] The following provides specific embodiments in conjunction with the accompanying drawings:
[0121] like Figure 5 As shown, it is a structural schematic diagram of a node classification device based on multi-level semantic information representation of heterogeneous knowledge graphs in an embodiment of the present invention.
[0122] The node classification device 5 based on the multi-level semantic information representation of heterogeneous knowledge graph includes:
[0123] An acquisition module 51 is used to acquire a heterogeneous knowledge graph dataset to be classified and preset multiple meta-paths;
[0124] The heterogeneous knowledge graph dataset to be classified includes a plurality of nodes; the types of nodes include: nodes with subcategory labels and nodes without subcategory labels;
[0125] A node representation information generating module 52 is connected to the acquisition module 51 and is used to perform node-level semantic information extraction processing and path-level semantic information extraction processing on the heterogeneous knowledge graph dataset to be classified according to the preset multiple meta-paths, so as to obtain node representation information of each node;
[0126] The node classification module 53 is connected to the node representation information 52 generation module, and is used to perform category-level semantic information extraction processing on the heterogeneous knowledge graph dataset to be classified based on the node representation information obtained for each node, and obtain the subcategory classification result of each node without a subcategory label.
[0127] It should be noted that the modules provided in this embodiment are similar to the methods provided above in the implementation mode, so they will not be repeated here. It should also be noted that it should be understood that the division of the modules of the above device is only a division of logical functions. In actual implementation, they can be fully or partially integrated into a physical entity, or physically separated. And these modules can all be implemented in the form of software called by processing elements; they can also be all implemented in the form of hardware; some modules can also be implemented in the form of software called by processing elements, and some modules can be implemented in the form of hardware. For example, the node classification module 53 can be a separately established processing element, or it can be integrated in a chip of the above device. In addition, it 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. The function of the above node classification module 53. The implementation of other modules is similar. In addition, these modules can be fully or partially integrated together, or they can be implemented independently. The processing element described here can be an integrated circuit with signal processing capabilities. In the implementation process, each step of the above method or each module above can be completed by an integrated logic circuit of hardware in a processor element or instructions in the form of software.
[0128] For example, the above modules may be one or more integrated circuits configured to implement the above methods, such as one or more application specific integrated circuits (ASICs), or one or more digital signal processors (DSPs), or one or more field programmable gate arrays (FPGAs). For another example, when a module is implemented in the form of a processing element scheduling program code, the processing element may be a general-purpose processor, such as a central processing unit (CPU) or other processors that can call program code. For another example, these modules may be integrated together and implemented in the form of a system-on-a-chip (SOC).
[0129] In one embodiment, according to a preset plurality of meta-paths, the heterogeneous knowledge graph dataset to be classified is subjected to node-level semantic information extraction processing and path-level semantic information extraction processing respectively to obtain node representation information of each node, including: according to a preset plurality of meta-paths, the heterogeneous knowledge graph dataset to be classified is subjected to node-level semantic information extraction processing to obtain node-level semantic information of each node under each meta-path; according to a preset plurality of meta-paths, the heterogeneous knowledge graph dataset to be classified is subjected to path-level semantic information extraction processing to obtain path-level semantic information of each node under each meta-path; the node-level semantic information and path-level semantic information of each node under each meta-path are superimposed to obtain the node semantic information of each node under each meta-path; the node semantic information of each node under each meta-path is superimposed to obtain the node representation information of each node.
[0130] In one embodiment, according to a preset plurality of meta-paths, the heterogeneous knowledge graph data set to be classified is subjected to node-level semantic information extraction processing to obtain node-level semantic information of each node under each meta-path, including: according to the preset plurality of meta-paths and each node, a search is performed in the heterogeneous knowledge graph data set to obtain a plurality of meta-path instances of each node under each meta-path; based on the plurality of meta-path instances of each node under each meta-path, single-node-level instance representation information and double-node-level instance representation information corresponding to each meta-path instance of each node under each meta-path are obtained by performing single-node aggregation processing and double-node aggregation processing on the meta-path instances, and the two are added to obtain the node instance representation information corresponding to each meta-path instance of each node under each meta-path; based on the node instance representation information corresponding to each meta-path instance of each node under each meta-path, node-level semantic information of each node under each meta-path is generated by weighting processing.
[0131] In one embodiment, each node also has a main category label; wherein each subcategory label is associated with a main category label.
[0132] In one embodiment, according to a preset plurality of meta-paths, path-level semantic information extraction processing is performed on the heterogeneous knowledge graph dataset to be classified to obtain path-level semantic information of each node under each meta-path, including: according to the preset plurality of meta-paths and each node, a subgraph of each node under each meta-path is obtained from the heterogeneous knowledge graph dataset to be classified; a node superposition operation with the same number of hops is performed on the subgraph of each node under each meta-path to obtain path-level semantic information of each node under each meta-path; wherein nodes with the same number of hops have the same main category label.
[0133] In one embodiment, based on the node representation information of each node obtained, the heterogeneous knowledge graph dataset to be classified is subjected to category-level semantic information extraction processing to obtain the subcategory classification result of each node without a subcategory label, including: according to each subcategory label, the nodes with subcategory labels in the heterogeneous knowledge graph dataset to be classified are screened for subcategory labels to obtain a node set for each subcategory label; utilizing degree centrality, by adopting the shortest path length sorting method, determining the core node set for each subcategory label from the node set for each subcategory label; based on the core node set of each subcategory label, performing multiple rounds of node classification operations to obtain multiple rounds of subcategory classification results for each node without a subcategory label; and performing statistics on the multiple rounds of subcategory classification results for each node without a subcategory label to obtain the final subcategory classification result for each node without a subcategory label.
[0134] In one embodiment, each round of node classification operation includes: determining the central node corresponding to each subcategory label in this round from the core node set of each subcategory label; based on the central node corresponding to each subcategory label determined in this round, generating the category label representation information corresponding to each subcategory label in this round through a central projection operation based on the node representation information; inputting the category label representation information corresponding to each subcategory label in this round into the heterogeneous knowledge graph dataset of this round, and updating the heterogeneous knowledge graph dataset of this round using GNN; outputting the updated heterogeneous knowledge graph dataset as the heterogeneous knowledge graph dataset corresponding to the next round; based on the updated heterogeneous knowledge graph dataset, by executing the node classification task of this round, obtaining the subcategory classification result of each node without subcategory label in this round.
[0135] like Figure 6 As shown, it is a schematic diagram of the structure of the electronic terminal in an embodiment of the present invention.
[0136] The terminal 6 comprises: a processor 62 and a memory 61; the memory 61 is used to store a computer program; the processor 62 is used to execute the computer program stored in the memory, so that the terminal 6 performs the following steps: Figure 1 The node classification method is based on multi-level semantic information representation of heterogeneous knowledge graphs.
[0137] Optionally, the number of the memory 61 can be one or more, the number of the processor 62 can be one or more, and Figure 6 Take one as an example.
[0138] Optionally, the processor 62 in the control device will Figure 2In the above steps, one or more instructions corresponding to the process of the application are loaded into the memory 61, and the processor 62 runs the application stored in the first memory, thereby achieving the following Figure 1 The various functions in the node classification method based on multi-level semantic information representation of heterogeneous knowledge graphs.
[0139] Optionally, the memory 61 may include but is not limited to high-speed random access memory and non-volatile memory. For example, one or more disk storage devices, flash memory devices or other non-volatile solid-state storage devices; the processor 62 may include but is not limited to a central processing unit (CPU), a network processor (NP), etc.; it may also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components.
[0140] Optionally, the processor 62 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0141] The present invention also provides a computer-readable storage medium storing a computer program, wherein the computer program is executed as follows: Figure 1The node classification method based on multi-level semantic information representation of heterogeneous knowledge graphs. The computer-readable storage medium may include, but is not limited to, a floppy disk, an optical disk, a CD-ROM (read-only disk memory), a magneto-optical disk, a ROM (read-only memory), a RAM (random access memory), an EPROM (erasable programmable read-only memory), an EEPROM (electrically erasable programmable read-only memory), a magnetic card or an optical card, a flash memory, or other types of media / machine-readable media suitable for storing machine-executable instructions. The computer-readable storage medium may be a product that is not connected to a computer device, or a component that is connected to a computer device for use.
[0142] In some embodiments of the present invention, the computer readable and writable storage medium may include a read-only memory, a random access memory, an EEPROM, a CD-ROM or other optical disk storage device, a magnetic disk storage device or other magnetic storage device, a flash memory, a USB flash drive, a mobile hard disk, or any other medium that can be used to store the desired program code in the form of an instruction or data structure and can be accessed by a computer. In addition, any connection can be appropriately referred to as a computer-readable medium. For example, if the instruction is sent from a website, server or other remote source using a coaxial cable, a fiber optic cable, a twisted pair, a digital subscriber line (DSL), or wireless technologies such as infrared, radio and microwaves, the coaxial cable, fiber optic cable, twisted pair, DSL, or wireless technologies such as infrared, radio and microwaves are included in the definition of the medium. However, it should be understood that computer readable and writable storage media and data storage media do not include connections, carriers, signals or other temporary media, but are intended to be non-temporary, tangible storage media. Disk and disc, as used in this application, includes compact disc (CD), laser disc, optical disc, digital versatile disc (DVD), floppy disk and Blu-ray disc where disks usually reproduce data magnetically, while discs reproduce data optically with lasers.
[0143] In summary, the present application provides a node classification method, device, terminal and medium based on multi-level semantic information representation of heterogeneous knowledge graphs. According to a plurality of preset meta-paths, the heterogeneous knowledge graph data set to be classified is subjected to node-level semantic information extraction processing and path-level semantic information extraction processing respectively, and then the heterogeneous knowledge graph data set to be classified is subjected to category-level semantic information extraction processing to obtain the sub-classification results of each node without a sub-category label in the heterogeneous knowledge graph data set to be classified. The present application enhances the existing path information aggregation mechanism through node-level semantic information extraction processing, captures the inherent semantic information related to the meta-path through path-level semantic information extraction processing, and improves the accuracy and robustness of the node classification process through category-level semantic information extraction processing, and makes full use of the complex semantic information in the heterogeneous knowledge graph. Therefore, the present application effectively overcomes the various shortcomings in the prior art and has a high industrial utilization value.
[0144] The above embodiments are merely illustrative of the principles and effects of the present application and are not intended to limit the present application. Anyone familiar with the technology may modify or change the above embodiments without violating the spirit and scope of the present application. Therefore, all equivalent modifications or changes made by a person of ordinary skill in the art without departing from the spirit and technical ideas disclosed in the present application shall still be covered by the claims of the present application.
Claims
1. A node classification method based on multi-level semantic information representation of heterogeneous knowledge graphs, applied to the semantic information representation field of heterogeneous knowledge graphs, characterized in that: include: Obtain a heterogeneous knowledge graph dataset to be classified and preset multiple meta-paths; The heterogeneous knowledge graph dataset to be classified includes a plurality of nodes; the types of nodes include: nodes with subcategory labels and nodes without subcategory labels; According to the preset multiple meta-paths, the heterogeneous knowledge graph dataset to be classified is subjected to node-level semantic information extraction processing and path-level semantic information extraction processing to obtain node representation information of each node; According to the preset multiple meta-paths, the heterogeneous knowledge graph dataset to be classified is subjected to node-level semantic information extraction processing and path-level semantic information extraction processing respectively, so as to obtain the node representation information of each node, including: According to the preset multiple meta-paths, the node-level semantic information extraction processing is performed on the heterogeneous knowledge graph dataset to be classified to obtain the node-level semantic information of each node under each meta-path; According to the preset multiple meta-paths, the path-level semantic information extraction processing is performed on the heterogeneous knowledge graph dataset to be classified to obtain the path-level semantic information of each node under each meta-path; The node-level semantic information and path-level semantic information of each node under each meta-path are superimposed to obtain the node semantic information of each node under each meta-path; The node semantic information of each node under each meta-path is superimposed to obtain the node representation information of each node; Based on the obtained node representation information of each node, the category-level semantic information extraction processing is performed on the heterogeneous knowledge graph dataset to be classified to obtain a subcategory classification result of each node without a subcategory label; Wherein, based on the obtained node representation information of each node, the semantic information extraction process of the category level is performed on the heterogeneous knowledge graph dataset to be classified, and the subcategory classification result of each node without a subcategory label is obtained, including: According to each subcategory label, the nodes with subcategory labels in the heterogeneous knowledge graph dataset to be classified are screened for subcategory labels to obtain a node set of each subcategory label; Using degree centrality, the core node set of each sub-category label is determined from the node set of each sub-category label by sorting by the shortest path length; And wherein, by using degree centrality and sorting by the shortest path length, a core node set of each sub-category label is determined from the node set of each sub-category label, including: For each sub-category label, use degree centrality to select the first n nodes with the highest degree in the node set of the sub-category label; calculate the shortest path length from each node in the first n nodes with the highest degree to each node in the remaining nodes in the node set of the sub-category label, so as to calculate the average shortest path length from each node in the first n nodes with the highest degree to the node set of the sub-category label; sort the calculated average shortest path length from each node in the first n nodes with the highest degree to the node set of the sub-category label from small to large, and output the first m nodes as the core node set corresponding to the sub-category label; Based on the core node set of each subcategory label, through multiple rounds of node classification operations, a multi-round subcategory classification result of each node without a subcategory label is obtained; The multi-round subcategory classification results of each node without a subcategory label are counted to obtain the final subcategory classification result of each node without a subcategory label.
2. The node classification method based on multi-level semantic information representation of heterogeneous knowledge graph according to claim 1 is characterized in that: According to the preset multiple meta-paths, the node-level semantic information extraction processing is performed on the heterogeneous knowledge graph dataset to be classified, and the node-level semantic information of each node under each meta-path is obtained, including: According to the preset multiple meta-paths and each node, a search is performed in the heterogeneous knowledge graph dataset to obtain multiple meta-path instances of each node under each meta-path; Based on multiple meta-path instances of each node under each meta-path, by performing single-node aggregation processing and double-node aggregation processing on the meta-path instances, single-node level instance representation information and double-node level instance representation information corresponding to each meta-path instance of each node under each meta-path are obtained, and the two are added to obtain the node instance representation information corresponding to each meta-path instance of each node under each meta-path; Based on the node instance representation information corresponding to each meta-path instance of each node under each meta-path, the node-level semantic information of each node under each meta-path is generated through weighting processing.
3. The node classification method based on multi-level semantic information representation of heterogeneous knowledge graph according to claim 1 is characterized in that: Each node also has a main category label; wherein each subcategory label has an association relationship with a main category label.
4. The node classification method based on multi-level semantic information representation of heterogeneous knowledge graph according to claim 3 is characterized in that: According to the preset multiple meta-paths, the path-level semantic information extraction processing is performed on the heterogeneous knowledge graph dataset to be classified, and the path-level semantic information of each node under each meta-path is obtained, including: According to the preset multiple meta-paths and each node, a subgraph of each node under each meta-path is obtained from the heterogeneous knowledge graph dataset to be classified; The subgraph of each node under each meta-path is superimposed with nodes of the same hop number to obtain the path-level semantic information of each node under each meta-path; wherein nodes of the same hop number have the same main category label.
5. The node classification method based on multi-level semantic information representation of heterogeneous knowledge graph according to claim 3 is characterized in that: Each round of node classification operations includes: Determine the central node corresponding to each subcategory label in this round from the core node set of each subcategory label; Based on the central node corresponding to each sub-category label determined in this round, the category label representation information corresponding to each sub-category label in this round is generated through a central projection operation based on the node representation information; The category label representation information corresponding to each subcategory label in this round is input into the heterogeneous knowledge graph dataset of this round, and the heterogeneous knowledge graph dataset of this round is updated using GNN; the updated heterogeneous knowledge graph dataset is output as the heterogeneous knowledge graph dataset corresponding to the next round; Based on the updated heterogeneous knowledge graph dataset, by executing the node classification task of this round, the subcategory classification results of each node without subcategory mark in this round are obtained.
6. A node classification device based on multi-level semantic information representation of heterogeneous knowledge graph, characterized in that: include: An acquisition module is used to acquire a heterogeneous knowledge graph dataset to be classified and preset multiple meta-paths; The heterogeneous knowledge graph dataset to be classified includes a plurality of nodes; the types of nodes include: nodes with subcategory labels and nodes without subcategory labels; A node representation information generation module is connected to the acquisition module and is used to perform node-level semantic information extraction processing and path-level semantic information extraction processing on the heterogeneous knowledge graph dataset to be classified according to a plurality of preset meta-paths, so as to obtain node representation information of each node; According to the preset multiple meta-paths, the heterogeneous knowledge graph dataset to be classified is subjected to node-level semantic information extraction processing and path-level semantic information extraction processing respectively, so as to obtain the node representation information of each node, including: According to the preset multiple meta-paths, the node-level semantic information extraction processing is performed on the heterogeneous knowledge graph dataset to be classified to obtain the node-level semantic information of each node under each meta-path; According to the preset multiple meta-paths, the path-level semantic information extraction processing is performed on the heterogeneous knowledge graph dataset to be classified to obtain the path-level semantic information of each node under each meta-path; The node-level semantic information and path-level semantic information of each node under each meta-path are superimposed to obtain the node semantic information of each node under each meta-path; The node semantic information of each node under each meta-path is superimposed to obtain the node representation information of each node; A node classification module, connected to the node representation information generation module, is used to perform semantic information extraction processing at the category level on the heterogeneous knowledge graph dataset to be classified based on the node representation information obtained for each node, and obtain a subcategory classification result for each node without a subcategory label; Wherein, based on the obtained node representation information of each node, the semantic information extraction process of the category level is performed on the heterogeneous knowledge graph dataset to be classified, and the subcategory classification result of each node without a subcategory label is obtained, including: According to each subcategory label, the nodes with subcategory labels in the heterogeneous knowledge graph dataset to be classified are screened for subcategory labels to obtain a node set of each subcategory label; Using degree centrality, the core node set of each sub-category label is determined from the node set of each sub-category label by sorting by the shortest path length; And wherein, by using degree centrality and sorting by the shortest path length, a core node set of each sub-category label is determined from the node set of each sub-category label, including: For each sub-category label, use degree centrality to select the first n nodes with the highest degree in the node set of the sub-category label; calculate the shortest path length from each node in the first n nodes with the highest degree to each node in the remaining nodes in the node set of the sub-category label, so as to calculate the average shortest path length from each node in the first n nodes with the highest degree to the node set of the sub-category label; sort the calculated average shortest path length from each node in the first n nodes with the highest degree to the node set of the sub-category label from small to large, and output the first m nodes as the core node set corresponding to the sub-category label; Based on the core node set of each subcategory label, through multiple rounds of node classification operations, a multi-round subcategory classification result of each node without a subcategory label is obtained; The multi-round subcategory classification results of each node without a subcategory label are counted to obtain the final subcategory classification result of each node without a subcategory label.
7. An electronic terminal, characterized in that: include: Processor and memory; The memory is used to store computer programs; The processor is configured to execute the computer program stored in the memory, so as to enable the terminal to perform the method according to any one of claims 1 to 5.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method described in any one of claims 1 to 5 is implemented.
Citation Information
Patent Citations
Model generation method and device for representing heterogeneous graph nodes
CN111708922A
Knowledge reasoning method based on multi-modal knowledge graph
CN112288091A