Knowledge graph relation extraction method fusing syntactic structure and domain rule
By constructing a graph convolutional network model with enhanced syntactic rules, the problem of insufficient understanding of complex terms in the power distribution network field is solved, and highly accurate and interpretable relation extraction is achieved, which is applicable to multiple vertical fields.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-01-07
- Publication Date
- 2026-04-03
AI Technical Summary
In highly specialized fields such as power distribution networks, existing technologies suffer from insufficient understanding of complex domain terminology, poor accuracy and robustness in relation extraction, and difficulty in meeting the requirements of high accuracy and high reliability. Furthermore, existing methods struggle to explicitly incorporate domain-specific prior rules and connection logic.
We construct a graph convolutional network model with enhanced syntactic rules. By weighted fusion of syntactic dependency matrix and domain rule matrix, we introduce a dependency type attention mechanism to perform semantic propagation and aggregation, thereby improving the accuracy of entity relationship classification.
It significantly improves relation extraction performance, enhances model interpretability and efficiency in utilizing domain knowledge, and is applicable to multiple vertical domains.
Smart Images

Figure CN121787547A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of natural language processing and knowledge graph construction technology, specifically to a relation extraction method applicable to vertical domains, particularly for knowledge graph construction of power distribution network equipment. More specifically, this invention relates to a knowledge graph relation extraction method that integrates syntactic structure and domain rules. Background Technology
[0002] Knowledge graphs, as structured semantic knowledge bases, are the core infrastructure for intelligent question answering, semantic search, and decision support. Their automated construction relies on accurately extracting entities and semantic relationships between them from massive amounts of unstructured text. In recent years, deep learning models, especially methods combining pre-trained language models with graph neural networks (GNNs), have become the mainstream technology for relation extraction.
[0003] However, general-purpose models face significant challenges when applied to highly specialized fields such as power distribution networks. First, the models lack a deep understanding of complex domain terms and their varied expressions, such as "circuit breaker," "disconnector," and "fuse." Second, while existing methods, such as Attention Graph Convolutional Networks (ATT-GCN), can dynamically construct inter-word relationship graphs, these graph structures lack linguistic constraints, have weak interpretability, and are essentially data-driven, making it difficult to explicitly and controllably incorporate inherent domain-specific prior rules and connection logic, such as "circuit breaker must be paired with disconnector." This results in insufficient accuracy and robustness in relation extraction from specialized texts, making it difficult to meet the high accuracy and reliability requirements of power equipment knowledge management.
[0004] For example, in existing technologies, such as the method proposed by Wu Tongxin et al. based on dependency syntax trees and graph convolutional networks, although syntactic information is introduced, all edges in the dependency tree are often treated equally, ignoring the differentiated semantic role information carried by different dependency types such as "subject-verb", "verb-object", and "attributive-head". At the same time, it fails to inject the structured knowledge of domain experts into the model's learning process in a computable form.
[0005] Specifically, existing technologies have the following limitations in utilizing syntactic information: (1) Lack of dependency type information: For example, most dependency tree-based methods proposed by Zeng et al. in 2014 treat dependency trees as undirected or untyped graphs, ignoring the rich semantic role information contained in dependency types such as "nsubj" (noun subject), "dobj" (direct object), and "amod" (adjective modifier), resulting in the model being unable to distinguish the essential semantic difference between "circuit breaker control switch" and "circuit breaker switch". (2) Structural noise interference: Dependency trees often contain a large number of syntactic connections unrelated to relation judgment (such as edges brought by articles, auxiliary words, etc.), and these noisy edges will interfere with the effective propagation of information in graph neural networks. Some existing pruning strategies (such as fixed-distance pruning) lack adaptability and may mistakenly delete important long-distance dependencies.
[0006] In terms of domain knowledge fusion, existing solutions mostly adopt two paths, but both have obvious shortcomings: (1) Data-driven implicit learning: By continuing to pre-train the language model on massive amounts of domain text, it is hoped that the model will implicitly capture domain rules. This method is inefficient, and the learned knowledge is uncontrollable and uninterpretable, making it difficult to guarantee absolute compliance with key domain rules. (2) Post-processing rule verification: Applying rules to filter or correct the model's prediction results. This method is disconnected from the model training process, cannot form "knowledge constraints" within the model, and is difficult to handle when rules conflict. Therefore, there is an urgent need for a method that can embed domain knowledge in a structured, computable, and controllable way into the forward inference process of the model's core architecture.
[0007] Therefore, there is an urgent need for a relation extraction method that can explicitly integrate accurate syntactic structure information with definable domain rule knowledge, and perform deep semantic reasoning based on this integration, so as to improve the extraction accuracy, model interpretability and utilization efficiency of domain knowledge in professional fields such as power distribution networks. Summary of the Invention
[0008] (a) Purpose of the invention
[0009] This invention aims to overcome the aforementioned shortcomings of existing technologies and provide a knowledge graph relation extraction method that integrates syntactic structure and domain rules. The primary objective of this invention is to improve the accuracy and F1 score of relation extraction models in vertical domains (such as power distribution networks); secondly, by introducing interpretable syntactic rule modules, the interpretability of the model's decision-making process is enhanced; and finally, an end-to-end solution that effectively utilizes prior domain knowledge is provided to support the automated construction of high-quality domain knowledge graphs.
[0010] (II) Technical Solution
[0011] To achieve the above objectives, the core of the technical solution adopted in this invention lies in: constructing a graph convolutional network model with enhanced syntax rules, forming an information-enhanced graph structure through the weighted fusion of the "syntactic dependency matrix" and the "domain rule matrix", and introducing a "dependency type attention mechanism" on this graph for semantic propagation and aggregation, thereby accurately classifying the relationships between entities.
[0012] Specifically, a knowledge graph relation extraction method integrating syntactic structure and domain rules is characterized by the following steps: S1. Dual-channel graph structure construction: Dependency parsing is performed on the input text to generate a syntactic dependency adjacency matrix reflecting syntactic connections; simultaneously, based on a predefined domain rule base, text patterns are matched to generate a domain rule adjacency matrix containing domain knowledge. S2. Knowledge enhancement fusion: The syntactic dependency adjacency matrix and the domain rule adjacency matrix are weighted and fused to generate an enhanced adjacency matrix. This step includes configurable weight coefficients and entity mask filtering to ensure accurate injection of domain knowledge. S3. Semantically aware graph reasoning: The vectorized representation of the text (such as BERT encoding) and the enhanced adjacency matrix are input into a multi-layer graph convolutional network. This network innovatively introduces a dependency type attention mechanism to distinguish the importance of different syntactic dependency edges during feature aggregation. S4. Relation classification and output: From the node enhancement representation output by the graph convolutional network, vectors of target entity pairs are extracted to construct a joint feature vector containing interaction information (such as v). pair = [v p ;v q ; |v p - v q |; v p ⨀v q The classifier determines the relationship category and outputs structured triples.
[0013] Furthermore, the domain rule base includes at least: device connection rules (such as matching "connected" or "connected"), component composition rules (such as matching "includes" or "composed of"), and parameter association rules (such as matching "rated" or "parameter is"). These rules are encoded in matrix form, and their contribution to the final graph structure is controlled by weight parameters (λ1, λ2, λ3).
[0014] Furthermore, the dependency-type attention mechanism aggregates the information of its neighboring nodes j at computing node i with weights α. ij In addition to considering node features, the model also explicitly introduces the dependency relationship type embedding vector between nodes i and j to jointly calculate the attention score, enabling the model to distinguish the different importance of "subject-predicate relationship" and "attribute-head relationship" in semantic transmission.
[0015] (III) Beneficial Effects
[0016] Compared with the prior art, the present invention has the following significant advantages:
[0017] Significantly improved relation extraction performance: Through dual enhancement of syntax and domain rules, richer and more accurate supervision signals are provided to the model. Experiments show that the SR-GCN model proposed in this invention achieves an F1 score of 86.07% on the power distribution network equipment relation extraction dataset, which is 1.31 percentage points higher than the ATT-GCN baseline model (84.76%), demonstrating the effectiveness of the fusion method.
[0018] Enhanced interpretability of model decisions: The construction process of the syntactic and rule matrices is transparent and auditable. Domain experts can trace whether a particular relation prediction was reinforced by domain-specific rules (such as "connection rules") or which syntactic dependency path played a key role, which greatly enhances the model's credibility in safety-critical domains (such as electricity).
[0019] High efficiency in utilizing domain knowledge: This invention provides a structured and configurable method for injecting domain knowledge. By adjusting the rule matrix and its weights, it can be quickly adapted to other vertical domains such as healthcare and finance without redesigning the model architecture, achieving a balance between domain adaptability and generality.
[0020] Highly integrated and innovative technologies: This invention is not simply a collection of technical modules, but rather a deep and organic integration of dependency parsing, programmable domain rules, graph neural networks, and fine-grained attention mechanisms, forming an innovative, end-to-end relation extraction solution. Attached Figure Description
[0021] Figure 1 This is an overall flowchart of a knowledge graph relation extraction method that integrates syntactic structure and domain rules, provided in an embodiment of the present invention. Figure 2 This is a detailed architectural diagram of the Syntactic Rule Enhancement Graph Convolutional Network (SR-GCN) in an embodiment of the present invention. Figure 3 The enhanced adjacency matrix (A) in this embodiment of the invention enhanced A schematic diagram of the construction process. Figure 4 A modular structure diagram of a complete relation extraction system provided in an embodiment of the present invention. Figure 5 This is a bar chart comparing the performance of the relation extraction model with other baseline models in this embodiment of the invention. Figure 6 This is a bar chart showing the results of ablation experiments conducted in this embodiment of the invention to verify the contribution of each component. Detailed Implementation
[0022] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. The following embodiments are for illustrative purposes only and are not intended to limit the invention.
[0023] Example 1: A knowledge graph relation extraction method integrating syntactic structure and domain rules
[0024] This embodiment describes in detail the application of the method of the present invention in the text of power distribution network equipment, and the overall process is as follows: Figure 1 As shown.
[0025] S101: Input and Initialization
[0026] Input a description of a power distribution network device, such as: "10kV vacuum circuit breaker connected to the busbar via copper busbar". Use a named entity recognition tool (such as a pre-trained BiLSTM-CRF model) to label the entities: "10kV vacuum circuit breaker" (device) and "busbar" (device).
[0027] S102: Construction of Dual-Channel Graph Structure
[0028] Syntactic Channel: The dependency parsing is preferably performed using the Stanford CoreNLP tool, whose output is a dependency tree containing word indexes and dependency types (e.g., nsubj, dobj, prep). The dependency tree is then converted into a syntactic dependency adjacency matrix A. syntax The algorithm is as follows: Initialize an n×n zero matrix; traverse each edge (i, j, type) in the dependency tree, where i is the governor index and j is the dependent index; if i and j have a direct dependency relationship (e.g., "connection" as the core word has relationships with "circuit breaker" and "busbar" respectively), then add A from the matrix. syntax [i][j] and A syntax The values of [j][i] are all set to 1 to construct an undirected graph; at the same time, the dependency type of the edge is recorded to the corresponding position T[i][j] of an independent dependency type matrix T for subsequent attention calculation.
[0029] Rule Channel: The predefined domain rule base is an extensible collection, and each rule is a triple (rule type, pattern, weight).
[0030] (Connection rule, “{Entity A}[Connect|Join|Connect]{Entity B}”, λ1)
[0031] (Composition rule, "{Entity A} is composed of {Entity B} | {Entity A} includes {Entity B}", λ2)
[0032] (Parameter rule, “{entity A}’s [rated|nominal]{parameter B} is {value}”, λ3)
[0033] Rule matching employs pattern recognition based on regular expressions. When the input text triggers a rule, the value of the node index corresponding to the entity pair (entity A, entity B) captured in the rule pattern is increased by the weight of that rule in the domain rule adjacency matrix R. Initially, all R matrices are zero matrices.
[0034] Connection rule (ConnPattern): If the pattern "[Entity A] connects to [Entity B]" is detected, then in R... connect In the matrix, set the values of the corresponding node positions for "circuit breaker" and "bus" to 1. (In this example, component rule R...) part and parameter rule R param Not triggered; its matrix is 0.
[0035] This step corresponds to Figure 2 The "Syntax Rule Graph Construction Module" in the text.
[0036] S103: Knowledge Enhancement Integration
[0037] Weighted fusion is performed according to the formula: A enhanced =A syntax +λ1R connect +λ2R part +λ3R param The weight coefficients λ1, λ2, λ3 ∈ [0, 1] physically represent the confidence enhancement strength of the corresponding domain rules relative to the basic syntactic structure. The coefficients can be determined through grid search, optimization algorithms based on validation set performance, or directly assigned by domain experts based on rule determinism. In a preferred embodiment, optimization on the validation set via grid search yields λ1 = 0.4, λ2 = 0.3, and λ3 = 0.3.
[0038] Subsequently, the entity mask matrix M is used. entity Perform filtering: A enhanced =A enhanced ⊙M entity This ensures that rules are only added to edges between entity nodes. The entity mask matrix M entity M is an n×n binary matrix, generated as follows: if node i and node j are both entity nodes identified by the named entity recognition module, then M... entity [i][j] = 1, otherwise 0. This operation ensures that the enhancement of domain knowledge is precisely focused on the connections between entity nodes, avoiding the introduction of noise into ordinary word nodes. Finally, element-level truncation is performed: A enhanced =min(A enhanced,1). This process is as follows: Figure 3 As shown, the final enhanced graph structure was generated.
[0039] S104: Semantic-Aware Graph Reasoning
[0040] The sentence is input into the BERT model to obtain the context vector representation of each word, which serves as the initial feature H for the graph nodes. (0) .
[0041] H (0) With A enhanced Input a 2-layer graph convolutional network (GCN).
[0042] In message passing at each layer of the GCN, a dependency-type attention mechanism is employed. For each edge, its attention weight α... ij It is calculated jointly from the source node features, the target node features, and the dependency relationship type embedding vector of the edge. This enables the model to distinguish the semantic contributions of different syntactic relations.
[0043] After multiple propagation layers, the final enhanced representation G of all nodes is obtained.
[0044] S105: Relation Classification and Output
[0045] For a target entity pair ("circuit breaker", "bus"), extract the vector representation v of its corresponding node from G. p and v q Construct a joint feature vector: v pair = [v p ; v q ; |v p - v q |; v p ⨀v q This vector is input into a fully connected layer combined with a Softmax classifier to calculate the probability that it belongs to each predefined relation (such as "connection", "composition", "parameter association" etc.). Finally, the relation with the highest probability is output to form a triple (10kV vacuum circuit breaker, connection, busbar).
[0046] Example 2: System Example
[0047] This embodiment provides a system for implementing the method described in Embodiment 1, the architecture of which is as follows: Figure 4 As shown. The system is deployed on a server and includes the following functional modules:
[0048] Text preprocessing and entity recognition module: Receives raw text and performs word segmentation and entity annotation.
[0049] Syntactic rule graph construction module: integrates a syntactic parser and a domain rule engine, executes step S102, and outputs A. syntax and rule matrix.
[0050] Graph Enhancement Fusion Module: Executes step S103 to complete matrix weighted fusion and filtering, outputting A. enhanced .
[0051] Graph Neural Network Inference Module: Loads pre-trained BERT and GCN parameters, executes step S104, and completes node representation learning.
[0052] Relation classification and output module: Executes step S105 to output the final relation triples. The modules are interconnected via a standard data interface, forming an automated processing pipeline.
[0053] Example 3: Experiment and Effect Verification Example This example verifies the effectiveness of the method of the present invention through detailed experimental data.
[0054] 1. Experimental Setup
[0055] Dataset: A dedicated dataset constructed from equipment manuals and regulations was used. After rigorous screening, the final dataset contains 1702 high-quality statements, involving 400 typical power distribution network equipment entities, covering major equipment types such as transformers, circuit breakers, disconnectors, and cables. Regarding relationship annotation, six relationship types were defined based on the characteristics of power distribution network equipment management: Alias Relationship (SE): The correspondence between the standard name and commonly used aliases of equipment. Composition Relationship (DP): The containment relationship between equipment and its constituent parts. Association Relationship (DRN): The functional or structural relevance of equipment. Hierarchical Relationship (OC): The hierarchical relationship between the overall equipment and its constituent equipment. Collaboration Relationship (CWD): The functional coordination relationship of equipment during operation. No Relationship (UR): No obvious association between equipment. The dataset was randomly divided into a training set (1362 statements) and a test set (340 statements) in an 8:2 ratio to ensure the reliability of model training and evaluation.
[0056] Comparison Models: To comprehensively evaluate the performance, the SR-GCN model proposed in this invention was compared with six mature models: Convolutional Neural Network (CNN), Probabilistic Convolutional Neural Network (PCNN
[11] ), Bidirectional Long Short-Term Memory Network (BiLSTM), Graph Convolutional Network (GCN), Graph Attention Mechanism (GAT), and Attention Enhanced Graph Convolutional Network (ATT-GCN).
[0057] Evaluation metrics: The evaluation criteria for relation extraction tasks adopt three core metrics: recall, precision, and F1 score, to comprehensively evaluate model performance.
[0058] Parameter Configuration: The experiments of this invention were conducted on a computer equipped with an NVIDIA GeForce GTX 1660 Ti GPU. The specific software and hardware environment is as follows: operating system: Windows 11; programming language: Python 3.12; deep learning framework: PyTorch 1.8; central processing unit (CPU): AMD Ryzen 7 4800H, clock speed: 2.90 GHz; system memory: 16 GB. This configuration provided the necessary computational support for model training.
[0059] The relation extraction model uses 128-dimensional embedding vectors as the basic representation of the text sequence, with a batch size of 64. The training process consists of 50 epochs with an initial learning rate of 5e-4, and a Dropout ratio of 0.6 to prevent overfitting. The graph convolutional network adopts a two-layer architecture, with each layer having a hidden dimension of 256. These parameter configurations were optimized through iterative grid search tuning on the validation set.
[0060] 2. Comparison of experimental results
[0061] The proposed SR-GCN method achieved optimal results across all evaluation metrics. PCNN slightly outperformed CNN in F1 score, reflecting that its introduced piecewise max pooling more accurately extracts the relative positional features between the first and last entities, thus enhancing its ability to capture contextual semantics. Both GCN and GAT integrate neighborhood node information based on graph structures to update node representations, but their implementation mechanisms differ: GCN relies on the Laplacian matrix, while GAT introduces attention weights to highlight important neighborhood nodes. Experimental results show that GAT outperforms GCN due to its more effective fusion of inter-node association features. Furthermore, ATT-GCN improves performance on top of GAT by introducing dependency type information. In contrast, SR-GCN integrates syntactic dependency structures and domain prior knowledge, achieving a further 1.31% improvement in F1 score compared to ATT-GCN, demonstrating its stronger feature modeling capability. The performance comparison visualization results are shown below. Figure 5 As shown.
[0062] 3. Ablation Experiment Results
[0063] To verify the contributions of each core component, ablation experiments were conducted, and the results clearly quantified the contributions of each module. The "no domain rules" resulted in the most severe performance degradation (6.08%), strongly demonstrating the crucial role of structured domain knowledge in extracting domain-specific relationships. The degradation in "no BERT embeddings" (3.93%) highlights the necessity of the context-pre-trained model as a powerful feature extractor. The degradation in "no dependency type attention" (2.23%) indicates that refined and differentiated utilization of syntactic information, compared to simply using syntactic edges, can bring further stable gains. This fully demonstrates the necessity of the "syntax-rule" dual enhancement design in this invention and the synergistic effectiveness of its components. The visualization results of the ablation experiments are as follows: Figure 6 As shown.
[0064] Example 4: Electronic Device An electronic device includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, it implements the method described in Example 1. This electronic device can be a cloud server, an edge computing device, or a high-performance workstation, and is capable of performing complex natural language processing and graph neural network calculations.
[0065] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in this invention, and these modifications or substitutions should all be covered within the scope of protection of this invention. Therefore, the scope of protection of this invention should be determined by the scope of the claims.
Claims
1. A method for extracting knowledge graph relations by integrating syntactic structure and domain rules, characterized in that: Includes the following steps: S1. Perform dependency parsing on the input text containing target device entity pairs to generate a syntactic dependency adjacency matrix; simultaneously, based on a predefined power domain rule base, identify the domain relationships between device entities in the input text to generate a power domain rule adjacency matrix. S2. The syntactic dependency adjacency matrix and the power domain rule adjacency matrix are weighted and fused to generate an enhanced adjacency matrix; S3. Input the vectorized representation of the input text and the enhanced adjacency matrix into a multi-layer graph convolutional network for feature propagation and aggregation to obtain a node enhanced representation that integrates syntax and domain knowledge; S4. Based on the node enhancement representation, extract the representation of the target device entity pair and construct a classification feature vector. Obtain the relationship category of the device entity pair through a relationship classifier to complete the relationship extraction.
2. The knowledge graph relation extraction method integrating syntactic structure and domain rules as described in claim 1, characterized in that: In step S1, the domain rule base includes at least one of device connection rules, component composition rules, and parameter association rules.
3. The method as described in claim 2, characterized in that: The device connection rules are used to match text patterns that represent physical connection relationships between devices; the component composition rules are used to match text patterns that represent the inclusion relationship between a whole and its components; and the parameter association rules are used to match text patterns that represent the association relationship between a device and its technical parameters.
4. A knowledge graph relation extraction method integrating syntactic structure and domain rules as described in claim 1 or 2, characterized in that: In step S2, the specific steps of weighted fusion are as follows: S2.1 Assign corresponding weight coefficients to the adjacency matrices of different types of domain rules; S2.2 Add the syntactic dependency adjacency matrix to the weighted adjacency matrices of each of the domain rules to obtain the initial enhancement matrix; S2.
3. The initial enhancement matrix is subjected to amplitude limiting and filtering to obtain the final enhancement adjacency matrix.
5. The knowledge graph relation extraction method integrating syntactic structure and domain rules as described in claim 4, characterized in that: The specific calculations in step S2.2 satisfy the following formula: A enhanced =A syntax +λ1R connect +λ2R part +λ3R param Among them, A enhanced Let A be the initial enhancement matrix. syntax Let R be the syntactic dependency adjacency matrix. connect R part R param These are rule matrices for device connection, component composition, and parameter association, respectively, with λ1, λ2, and λ3 being the corresponding weight coefficients.
6. The knowledge graph relation extraction method integrating syntactic structure and domain rules as described in claim 4, characterized in that: In step S2.3, the filtering process involves performing a dot product operation on the initial enhancement matrix using the entity mask matrix, so that the domain rules only apply to the connection edges between entity nodes.
7. The knowledge graph relation extraction method integrating syntactic structure and domain rules as described in claim 1, characterized in that: In step S3, the graph convolutional network incorporates a dependency type attention mechanism; the dependency type attention mechanism is used to dynamically adjust the importance weights of adjacent nodes according to the dependency relationship type between nodes when aggregating node features.
8. The knowledge graph relation extraction method integrating syntactic structure and domain rules as described in claim 7, characterized in that: The dependency type attention mechanism, when calculating the attention weights between a target node and its neighboring nodes, jointly considers the feature vectors of the target node, the feature vectors of the neighboring nodes, and the embedding vectors of the dependency relationship types between the two nodes, and generates the final attention weights through normalization processing.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, it implements the method as described in any one of claims 1 to 8.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by the processor, it implements the method as described in any one of claims 1 to 8.