Next Article in Journal
Design of a High-Resolution Reconfigurable Intelligent Surface for Slowly Time-Varying Scenarios
Previous Article in Journal
Read-Polarity-Aware Row-Wise Offset Encoding for Readout-Energy Reduction in 8T SRAM Compute-in-Memory
Previous Article in Special Issue
Autonomous Volt/Var Control in Active Distribution Networks via LLM-Driven Dynamic Reward Shaping
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

A Gated Neighbor Fusion-Based Knowledge Graph for Relay Protection Operation and Maintenance

1
Shenzhen Power Supply Bureau Co., Ltd., Shenzhen 518001, China
2
China-EU Institute for Clean and Renewable Energy, Huazhong University of Science and Technology (HUST), Wuhan 430074, China
3
State Key Laboratory of Advanced Electromagnetic Technology, School of Electrical and Electronic Engineering, Huazhong University of Science and Technology (HUST), Wuhan 430074, China
*
Author to whom correspondence should be addressed.
These authors contributed equally to this work.
Electronics 2026, 15(17), 3981; https://doi.org/10.3390/electronics15173981
Submission received: 28 July 2026 / Revised: 29 August 2026 / Accepted: 1 September 2026 / Published: 3 September 2026
(This article belongs to the Special Issue AI Applications for Smart Grid: 2nd Edition)

Abstract

Relay protection operation and maintenance (O&M) involves multi-source documents such as device manuals, O&M records, and industry regulations, with dense professional terminology and dispersed knowledge, making traditional retrieval methods inadequate for precise association. This paper proposes a knowledge graph construction and application method for relay protection O&M that incorporates a neighborhood gating mechanism. First, a domain schema is established covering five core entity types, primary equipment, protection functions, functional components, setting parameters, and secondary circuit signals, along with the semantic relationships between entities. Second, a MacBERT-GNF-CRF entity recognition model is proposed, which introduces a gated neighborhood feature fusion (GNF) mechanism on the basis of pre-trained semantic encoding to enhance local semantic representations near entity boundaries; experimental results show that this model achieves an F1 score of 0.946. A MacBERT-GNF-RC relation extraction model is constructed to realize automatic discrimination of semantic associations between entity pairs. After entity disambiguation and knowledge fusion, knowledge graph storage and visualization are completed based on Neo4j. Furthermore, a knowledge graph-enhanced alarm question-answering prototype is developed and evaluated using a representative 220 kV composite alarm case and 50 historical alarm cases. Expert evaluation shows that KG augmentation significantly improves alarm interpretation quality and evidence traceability compared to direct LLM answering.

1. Introduction

The relay protection system is a critical defense line ensuring the safe and stable operation of power systems [1,2]. With the increasing integration of renewable energy sources, distributed generators, and power electronic equipment, the characteristics of grid faults, short-circuit current levels, sequence component features, and protection operating conditions have all undergone significant changes. Traditional relay protection faces new challenges in sensitivity, selectivity, reliability, and coordination settings [3,4]. Meanwhile, digital protection devices, protection information systems, and substation monitoring systems continuously generate large volumes of SOE (Sequence of Events) alarms, action reports, device records, and O&M texts during operation, which are closely related to protection function numbers, communication protocols, and substation automation standards. Therefore, relay protection O&M is no longer merely the judgment of a single device action result, but rather a comprehensive analysis process involving multi-source data, multiple device types, various protection functions, and complex secondary circuit logic.
Relay protection O&M knowledge is typically dispersed across device manuals, operating regulations, alarm texts, and historical disposal records. Such texts are characterized by dense professional terminology, numerous abbreviations, and nested action criteria with complex logic. When on-site O&M personnel analyze complex alarms, they often need to search back and forth among multiple documents, manually sorting out the logical relationships between alarm signals, protection functions, functional components, setting parameters, and primary equipment. This process is not only time-consuming but also highly dependent on personal experience, making it difficult to ensure consistency and traceability of analysis results in complex scenarios.
Knowledge graphs can organize domain knowledge in the form of “entity–relationship–entity” triples and support semantic retrieval, association analysis, and explainable reasoning through explicit relational expressions [5,6]. In recent years, artificial intelligence, graph learning, and knowledge modeling methods have received widespread attention in the field of power system fault diagnosis and intelligent O&M. For example, research on distribution network fault diagnosis has shown that artificial intelligence and signal processing methods have become important technical directions for smart grid fault analysis [7]; GraphSAGE-based power system fault diagnosis and localization methods demonstrate that graph structure modeling can effectively express power grid topology and fault association information [8]. Furthermore, knowledge graph-enhanced methods for power secondary system operation risk assessment show that structured domain knowledge helps improve risk identification and semantic understanding capabilities [9]; research on named entity recognition for power equipment maintenance work orders also indicates that entity extraction from professional O&M texts is an important foundation for equipment knowledge organization and intelligent retrieval [10].
In the field of natural language processing, pre-trained language models and sequence labeling models provide effective methods for professional text knowledge extraction. BERT, MacBERT, and other pre-trained models can enhance contextual semantic representations [11,12], while BiLSTM-CRF and its improved models can combine contextual features and label transition constraints to improve entity boundary recognition [13,14]. For relation extraction, methods such as convolutional neural networks, attention mechanisms, and bidirectional recurrent neural networks have been widely used for semantic relationship discrimination between entity pairs [15,16]. However, in relay protection texts, entity boundaries are often determined by adjacent terms collectively. For example, continuous professional phrases such as “PT disconnection blocking logic,” “zero-sequence overcurrent protection startup,” and “distance protection blocking signal” have entity boundaries that depend on local neighborhood features near the boundaries, which may still be overlooked when relying solely on global contextual representations.
With the advancement of large language models and retrieval-enhanced generation techniques, integrating external knowledge into the Q&A generation process has become a key approach to enhancing the reliability of specialized queries. Traditional RAG systems improve Q&A performance by retrieving text fragments [17]; recent studies have combined knowledge graphs with RAG, demonstrating how structured evidence enhances retrieval and reasoning in manufacturing document Q&A [18], CNC fault diagnosis [19], and the general GraphRAG framework [20], providing valuable insights for interpreting relay protection alarms.
Although previous research has made progress in knowledge modeling and text extraction for power equipment operation and maintenance, significant shortcomings remain in relay protection applications: entity names are often lengthy with boundary dependencies that rely on local context, and existing models inadequately utilize neighborhood information; current knowledge graphs struggle to simultaneously represent engineering semantic relationships among secondary circuit signals, protection functions, functional components, set parameters, and primary equipment; existing validation efforts primarily focus on visual queries, lacking an alarm interpretation process that integrates knowledge graph triples with large language model (LLM) question-answering.
To address these limitations, this paper proposes a knowledge graph construction and application framework for relay protection O&M based on multi-source technical documents and operational alarm texts. At the knowledge extraction stage, a gated neighbor fusion (GNF) mechanism is introduced to adaptively integrate global contextual representations with adjacent semantic information without relying on external lexical resources. The mechanism is applied to entity recognition and further extended to candidate entity–pair relation classification. The main contributions of this paper are as follows:
(1) A domain schema layer oriented toward relay protection O&M is constructed, defining five core entity types—primary equipment, protection functions, functional components, setting parameters, and secondary circuit signals—along with four semantic relationships: triggers, contains, depends on, and linked to. This schema provides unified constraints for subsequent knowledge extraction, triple generation, and graph queries.
(2) A MacBERT-GNF-CRF entity recognition model is proposed, in which a learnable gate adaptively balances global contextual semantics and adjacent boundary information without requiring external lexical resources. The same GNF mechanism is further extended to candidate entity–pair relation classification.
(3) A MacBERT-GNF-RC relation extraction model is constructed to distinguish four domain relations and No Relation between candidate entity pairs. After filtering unrelated pairs, the extracted triples are normalized and imported into Neo4j for structured storage and graph-based retrieval.
(4) A knowledge graph-enhanced relay protection alarm Q&A prototype is constructed and validated using a 220 kV line protection composite alarm as an example, analyzing the role of graph triple evidence in alarm cause explanation and inspection suggestion generation.

2. Construction Method of the Relay Protection O&M Knowledge Graph

2.1. System Framework and Construction Process

Relay protection operation and maintenance knowledge is dispersed across various documents such as equipment manuals, protection system records, alarm logs, and maintenance logs. To achieve structured organization of this multi-source knowledge, this paper proposes a knowledge graph construction framework comprising a data layer, a knowledge extraction layer, and a knowledge application layer, as illustrated in Figure 1.
At the data layer, relay protection-related documents and alarm records are preprocessed to generate standardized text. In the knowledge extraction layer, the MacBERT-GNF-CRF model is employed for entity recognition, while a relation extraction model identifies semantic relationships between entities, enabling entity fusion and triple construction. At the knowledge application layer, triples are imported into the Neo4j graph database to support alarm correlation analysis and large language model-enhanced question-answering.

2.2. Domain Schema Layer Construction

To constrain the knowledge extraction and graph construction process, this paper defines five core entity types based on relay protection manuals, technical regulations, and on-site alarm records: Primary Equipment, Protection Function, Functional Component, Setting Parameter, and Secondary Circuit Signal. Specifically, Primary Equipment refers to the protected object and its associated bay or circuit; Protection Function corresponds to the protection principle or functional module inside the device; Functional Component represents the key discrimination unit within a protection function; Setting Parameter covers action thresholds, time delays, enabling conditions, and other setting values; Secondary Circuit Signal denotes alarm or event information from the monitoring system, including signal name, action/reset status, level, and timestamp.
Regarding relationship types, four semantic relationships are defined: triggers, contains, depends on, and linked to. The triggers relationship describes how a secondary circuit signal activates a related protection function; contains describes the composition between a protection function and its functional components; depends on describes the dependency of a protection function on setting parameters or blocking logic; linked to describes general semantic associations, such as the correspondence between a protection function and primary equipment, and the association between alarm signals and related protection functions. Figure 2 illustrates the domain schema layer of the relay protection O&M knowledge graph.

3. Knowledge Extraction and Fusion Method

Relay protection documentation is characterized by a high concentration of technical terminology, numerous abbreviations, and complex composite naming conventions, with entity boundaries often determined by local collocation relationships between adjacent terms. Therefore, this section designs the knowledge extraction method around two requirements: first, improving boundary-aware entity representation for NER; second, converting recognized entities into reliable entity–pair relations for triple construction. Specifically, MacBERT is used to capture global contextual semantics, the gated neighbor fusion (GNF) layer is introduced to strengthen local boundary features, and the CRF layer is used to enforce global label-sequence consistency. On this basis, a relation extraction module is further constructed to generate triples for subsequent knowledge fusion and graph construction.

3.1. Named Entity Recognition Model

Named Entity Recognition (NER) is a key technology for constructing high-quality domain knowledge graphs and realizing knowledge extraction in relay protection [21]. The proposed NER model adopts a hierarchical structure of MacBERT encoding, neighborhood feature fusion, and label decoding. It consists of a MacBERT pre-trained encoding layer, a gated neighbor feature fusion layer, a linear mapping layer, and a CRF decoding layer. The overall structure is shown in Figure 3.
The processing flow is as follows. The input text is encoded by MacBERT to obtain contextual semantic representations at each position. For each position, left and right neighborhood information is introduced and fused through a gating mechanism. The fused features are mapped by a linear layer to obtain tag emission scores. Finally, the CRF layer uses label transition constraints to decode the globally optimal label sequence. Different from a conventional CRF model that relies only on label transition probabilities, the proposed model explicitly injects neighborhood contextual information before CRF decoding, so that entity boundary features are strengthened at the representation stage.

3.2. MacBERT Pre-Trained Encoding Layer

MacBERT is a pre-trained language model specifically optimized for Chinese corpora. It addresses the inconsistency between pre-training and fine-tuning phases through strategies such as full-word masking, and N-gram masking, while enhancing the semantic representation capability of multi-character Chinese words [12].
In this paper, MacBERT is used as the basic encoder. Let the input text sequence be:
X = { x 1 , x 2 , , x n }
where x t denotes the input token at the t-th position and n is the sequence length. After MacBERT encoding, the contextual representation corresponding to each position is obtained as follows:
h t = M a c B E R T ( X ) t ,     t = 1 , 2 , , n
where h t R d and d is the hidden representation dimension. MacBERT is particularly suitable for Chinese professional texts because its masking strategy and perturbation mechanism reduce the mismatch between pre-training and downstream sequence labeling tasks.

3.3. Gated Neighbor Feature Fusion Layer

A relay protection entity typically consists of multiple consecutive terms, and its boundary identification relies on the local contextual relationships between the current position and its immediate neighbors. To enhance the local semantic representation near boundaries, this paper introduces a neighborhood-gated feature fusion layer following the MacBERT encoding layer.
Compared to existing local-feature enhancement approaches, the proposed GNF mechanism has two characteristics. First, conventional CNN-based local encoders typically aggregate neighboring features using shared convolution kernels, whereas GNF employs a learnable gate at each token position to adaptively balance the global contextual representation and the neighborhood-fused representation. This enables tokens inside long professional terms and those near entity boundaries to receive different degrees of local enhancement. Second, unlike lexicon-augmented Chinese NER methods that depend on external word dictionaries, GNF requires no additional lexical resources, making it suitable for relay protection texts containing numerous manufacturer-specific terms and abbreviations.
In the following equations, h t R d denotes the global contextual representation of the t -th token generated by the MacBERT encoder, where d is the hidden representation dimension. Accordingly, h t 1 and h t + 1 denote the contextual representations of the immediate left and right neighboring tokens, respectively. The local neighborhood vector c t is constructed by concatenating h t 1 , h t and h t + 1 . The candidate representation h ~ t denotes the neighborhood-enhanced representation obtained through nonlinear transformation, while g t ( 0 , 1 ) d denotes the learnable gate vector that adaptively controls the element-wise contribution of h ~ t and the original contextual representation h t . The resulting fused representation is denoted by z t .
For the t-th position in the sequence, its left-neighborhood representation h t 1 , current representation h t , and right-neighborhood representation h t + 1 are considered simultaneously, and the local neighborhood representation is constructed as:
c t = [ h t - 1 ; h t ; h t + 1 ]
where [ ; ] denotes vector concatenation. For the first and last positions of the sequence, missing neighborhood vectors are padded with zero vectors.
On this basis, a candidate fused representation is first generated through nonlinear mapping:
h ~ t = tanh ( W c c t + b c )
where W c and b c are trainable parameters. A gate vector is then introduced to control the weight allocation between the original representation of the current position and the neighborhood-fused representation:
g t = σ ( W g c t + b g )
where σ ( ) denotes the sigmoid function, and W g and b g are gate parameters. The enhanced local representation is finally defined as
z t = g t h ~ t + ( 1 g t ) h t
where denotes element-wise multiplication.
To improve training stability and reduce the influence of representation distribution differences across positions, the fused representation is further normalized:
z ^ t = L a y e r N o r m ( z t )
After gated neighbor fusion, local structural information is directly encoded into the representation of each token without significantly increasing model complexity, which benefits subsequent tag prediction. The structure of the gated neighbor feature fusion mechanism is shown in Figure 4.

3.4. Linear Mapping Layer

The enhanced representation from neighborhood gated feature fusion already contains the current position semantics and local neighborhood structural information. To map this feature to the label space, this paper uses a linear layer to generate the label emission score at each position:
o t = W o z ^ t + b o
where W o and b o are the linear mapping layer parameters, and o t denotes the emission score of each label corresponding to the t-th position, to be used by the subsequent CRF layer for decoding.

3.5. CRF Decoding Layer

Entity recognition requires not only correct classification at each position but also overall legality of the label sequence. For example, in BIO annotation, “I-Protection Function” cannot directly follow “B-Setting Parameter”. Therefore, this paper adds a Conditional Random Field (CRF) at the output layer to jointly constrain label transitions. Let the input sequence be X and the corresponding label sequence be Y = { y 1 , y 2 , , y n } ; then the total score of this label sequence can be expressed as:
s ( X , Y ) = t = 1 n o t , y t + t = 1 n 1 A y t , y t + 1
where   o t , y t denotes the emission score when the t-th position selects label y t , and A is the label transition matrix, describing the transition tendency between adjacent labels. The conditional probability is further defined as:
P ( Y | X ) = exp ( s ( X , Y ) ) Y   Y X exp ( s ( X , Y ) )
where Y X denotes the set of all possible legal label sequences for the input sequence X , and Y Y X denotes an arbitrary candidate label sequence. During training, the negative log-likelihood is used as the optimization objective. During prediction, the Viterbi algorithm is used to search for the label path with the highest score:
Y ^ = arg max Y   Y X s ( X , Y )
Here, Y ^ denotes the optimal label sequence predicted by the model; and s ( X , Y ) is the global sequence score computed by the CRF layer. By using Viterbi decoding, the model jointly considers label emission scores and transition constraints between adjacent labels, thereby reducing boundary errors near entities.

3.6. Relation Extraction Model

On the basis of the NER model, the CRF sequence decoding layer is replaced with a relation classification module to construct an entity–pair-oriented relation extraction model. The model also uses MacBERT to encode the text context and applies the GNF mechanism to strengthen local semantic features near entities. Following entity recognition, entity pairs co-occurring within the same sentence are generated as candidate pairs. The MacBERT-GNF-RC model classifies each candidate pair into one of five labels: triggers, contains, depends on, linked to, or No Relation. The model therefore jointly determines whether a semantic relation exists between two entities and identifies the corresponding relation type when a relation is present.
Let the head entity and tail entity in a sentence be eh and et, respectively. First, the GNF-enhanced representations of the tokens corresponding to the two entities are average-pooled to obtain the head entity representation   h h and the tail entity representation h t . The two entity representations are then concatenated to construct the joint feature vector of the entity pair:
v p a i r = [ h h ; h t ]
where [ ; ] denotes vector concatenation and v p a i r denotes the joint feature vector of the entity pair. The vector is then input to a fully connected classification layer to obtain the probability distribution over candidate relation classes:
p = S o f t m a x ( W r v p a i r + b r )
where W r and b r are the weight matrix and bias of the relation classification layer, respectively, and p denotes the probability distribution over the predefined relation categories. Specifically, p r denotes the predicted probability that the candidate entity pair ( e h , e t ) belongs to relation category r , and   R denotes the predefined set of relation categories. The final predicted relation is selected as the class with the maximum probability:
r ^ = a r g m a x   r R p r
Figure 5 shows the architecture of the relation extraction model. The model reuses the MacBERT encoder and GNF layer from the NER stage, so that relation classification can exploit both global contextual semantics and local features near entity boundaries. The enhanced head and tail entity representations are concatenated and input into a Softmax classifier to predict the relation label. Entity pairs predicted as No Relation are discarded, while the remaining predictions are organized as candidate triples for manual verification, knowledge fusion, and graph construction.

3.7. Knowledge Fusion and Entity Disambiguation

To minimize node redundancy caused by synonymous expressions and variations in manufacturer naming, entity names must be standardized before being stored as triples. This paper establishes a specialized terminology dictionary containing 3718 standardized relay-protection terms and an abbreviation/alias mapping table containing 974 mappings, together with entity type constraint rules based on terminology conventions in the relay protection domain. These resources provide unified mappings for synonymous, abbreviated, and manufacturer-specific expressions, such as “CT secondary circuit” and “current transformer secondary circuit”. For entities not covered by these rules, manual verification is performed considering the entity context and engineering semantics; if consistent with existing entity definitions, they are standardized into corresponding standard entities; otherwise, they are added as new entity nodes to the knowledge graph. After these steps, the processed triples are imported into the Neo4j graph database.

4. Experimental Analysis and Results

This section presents experimental validation of the proposed knowledge extraction models. Section 4.1 introduces the data sources, preprocessing pipeline, and annotation specifications. Section 4.2 evaluates the named entity recognition model performance through baseline comparisons and ablation studies. Section 4.3 further validates the effectiveness of the relation extraction model on entity–pair relation classification tasks.

4.1. Data Sources and Processing

The experimental corpus was constructed from a combination of normative technical documents and actual operation and maintenance texts in the relay protection domain. The normative sources mainly include relay protection device manuals, relay protection setting regulations, and power system operation evaluation specifications, whereas the operational sources include actual alarm records collected from relay protection O&M scenarios. Therefore, the corpus contains both standardized technical descriptions and real-world operational texts rather than relying on a single type of data source.
To improve data quality, the original texts are first uniformly preprocessed, including invalid character removal, duplicate content elimination, and correction of garbled tables and formulas. On this basis, long texts are segmented to meet the input length requirements of the pre-trained model. Subsequently, according to the entity type system constructed in this paper, the texts are manually annotated using the BIO annotation method to complete entity boundary and category identification. Some annotation examples are shown in Table 1.
A total of 5820 annotated samples containing 84,098 token-level labels were constructed, including 46,254 entity-labeled tokens and 37,844 O-labeled tokens. The samples were divided into training, validation, and test sets at an 8:1:1 ratio. Table 2 presents the label distribution, with B- and I-tags merged according to their corresponding entity categories.
Based on the annotated entities, entity pairs co-occurring within the same sentence were generated as relation candidates. Positive pairs were assigned one of four domain relation labels—triggers, contains, depends on, or linked to—while 3206 manually verified pairs without an explicit semantic relation were labeled as No Relation. The resulting dataset contained 9618 instances and was divided into 7694 training, 962 validation, and 962 test instances, as shown in Table 3.
The No Relation class accounts for approximately 33.3% of the relation classification dataset (3206 of 9618 instances). Although it is the largest individual class, the four positive relation categories collectively account for approximately 66.7% of the dataset. The No Relation instances were retained to provide sufficient negative entity–pair examples for learning whether an explicit semantic relation exists, while avoiding an excessively negative candidate distribution. For relation classification, macro-averaged Precision, Recall, and F 1 score are reported to reduce the influence of class-frequency differences on the overall evaluation.
Precision ( P ), Recall ( R ), and F 1 score are used as evaluation metrics. Precision measures the proportion of correctly identified entities in the recognition results, recall measures the proportion of actual entities that are correctly identified, and the F 1 score is the harmonic mean of the two:
P = T P T P + F P
R = T P T P + F N
F 1 = 2 P R P + R
where T P , F P , and F N denote the number of correctly identified entities, incorrectly identified entities, and missed entities in the confusion matrix, respectively. Entity matching adopts the strict matching criterion, i.e., it is counted as correct only when both the entity boundary and the type are correct.

4.2. Entity Extraction Experiment

To verify the effectiveness of the proposed entity extraction model, the experiments are completed in a computing environment equipped with an Intel Core i7 processor(Intel Corporation, Santa Clara, CA, USA), an NVIDIA GeForce RTX 3060 graphics card (NVIDIA Corporation, Santa Clara, CA, USA), and 32 GB of memory. The model is implemented based on Python 3.10, the deep learning framework adopts PyTorch 2.2.2, the CUDA version is 11.8, and the relevant training parameter settings are shown in Table 4. The model optimization adopts the AdamW optimizer, and a learning rate warmup mechanism is set to improve training stability.
To verify the effectiveness of the proposed entity recognition model, five models were compared: (1) BiLSTM-CRF; (2) MacBERT-CRF, which directly applies CRF decoding to MacBERT representations; (3) MacBERT-BiLSTM-CRF, which introduces a BiLSTM layer between MacBERT and CRF; (4) MacBERT-GlobalPointer, a span-based model that jointly identifies the start and end positions of entities [22]; and (5) the proposed MacBERT-GNF-CRF.
The experimental results are shown in Table 5. The proposed model achieves an F 1 -score of 0.946, improving the F 1 -score by 7.8, 3.0, 2.1 and 1.5 percentage points compared to BiLSTM-CRF, MacBERT-CRF, MacBERT-BiLSTM-CRF, and MacBERT-GlobalPointer, respectively. These results indicate that the proposed model can effectively improve entity recognition performance for relay protection texts. Figure 6 shows the F 1 -score curve of the entity recognition models on the validation set.
To further examine class-specific recognition errors, Figure 7 presents the entity-level confusion matrix of MacBERT-GNF-CRF on the test set for a representative run. Strict entity-level matching is adopted, whereby an entity is considered correct only when both its boundary and type are correctly predicted. In the matrix, “None” denotes unmatched entities rather than an additional entity type: the None column represents missed ground-truth entities, whereas the None row represents spurious predictions.
As shown in Figure 7, the representative run contains 1163 ground-truth entity mentions and 1168 predicted entity mentions, of which 1101 are correctly matched in both boundary and type. This corresponds to a precision of 0.943, a recall of 0.947, and an F1-score of 0.945, which are close to the five-run averages reported in Table 5. Most predictions are concentrated on the diagonal, indicating limited systematic confusion among the five entity types. The most noticeable type-level confusion occurs between Protection Function and Functional Component, with 7 Protection Function entities misclassified as Functional Component and 8 errors in the opposite direction. Unmatched predictions are also observed for several categories, reflecting the remaining difficulty in identifying entity boundaries and distinguishing semantically adjacent professional terms.
To further verify the contribution of each module in MacBERT-GNF-CRF, an ablation study was conducted. MacBERT-CRF removes the GNF module and uses only MacBERT and CRF for sequence labeling. MacBERT-Concat-CRF directly concatenates the current representation with left and right neighborhood representations without the gating mechanism. MacBERT-GNF-Softmax retains the GNF module but replaces CRF decoding with Softmax classification. MacBERT-GNF-CRF w/o LN removes the normalization operation from the GNF module. MacBERT-GNF-CRF is the complete model. Each ablation variant was independently trained three times, and the mean and standard deviation are reported.
Table 6 presents the results of ablation experiments for the entity recognition model. MacBERT-Concat-CRF achieved a higher F 1 score than MacBERT-CRF, indicating that neighborhood information aids in entity boundary detection; MacBERT-GNF-Softmax performed worse than the full model, demonstrating that CRF decoding remains essential for maintaining label sequence consistency; performance declined after removing LayerNorm, confirming that normalization helps stabilize feature fusion. The full model attained the highest F 1 score of 0.946, validating the effectiveness of neighborhood information, gated fusion, CRF decoding, and normalization.

4.3. Relation Extraction Experiment

To verify the performance of the relation extraction model, three models are set up: (1) BiLSTM-Attention; (2) MacBERT-CLS (directly using the [CLS] vector for classification); (3) the proposed MacBERT-GNF-RC model, which introduces gated neighbor fusion and entity–pair representation for relation classification. The training parameters are shown in Table 7.
The experimental results are shown in Table 8. The F 1 -score of the proposed model reaches 0.929, which is 5.3 percentage points higher than that of BiLSTM-Attention and 1.6 percentage points higher than that of MacBERT-CLS. This result indicates that transferring the GNF mechanism from the NER stage to the relation extraction task can effectively enhance local semantic aggregation around entity pairs.
Figure 8 shows the F 1 score variation curve of the relation extraction model on the validation set, demonstrating that our model achieves a high F 1 score during training.
To further investigate class-specific relation prediction errors, Figure 9 presents the confusion matrix of MacBERT-GNF-RC on the 962-instance test set for a representative run.
As shown in Figure 9, most predictions are concentrated along the diagonal, indicating good discrimination among the predefined relation labels. For this representative run, the macro-averaged precision, recall, and F1-score are 0.929, 0.932, and 0.930, respectively, which are close to the five-run averages reported in Table 8. The largest off-diagonal error occurs for No Relation instances predicted as linked to, with 16 such cases. In addition, 8 No Relation instances are classified as depends on, while 8 contains instances are predicted as No Relation. The relatively frequent confusion between linked to and No Relation is mainly attributable to the broader semantics of linked to, which represents general semantic associations and can therefore be more difficult to distinguish from weak or implicit associations between entity pairs. Overall, the remaining errors are concentrated primarily in semantically ambiguous relation boundaries rather than widespread confusion among explicit relation types.
To further analyze the influence of entity representation methods and the GNF mechanism on relation extraction performance, this paper sets up three model variants for comparison. MacBERT-CLS directly uses the [CLS] vector output by MacBERT for relation classification without explicitly introducing entity position information. MacBERT-Concat-RC average-pools the MacBERT representations at the head and tail entity positions and directly concatenates the two entity representations for classification without using the GNF mechanism. MacBERT-GNF-RC is the complete relation extraction model, which introduces the neighborhood gated feature fusion mechanism before entity representation generation and performs relation classification after concatenating the enhanced head and tail entity representations. Each relation classification variant was independently trained three times, and the results are reported as mean ± standard deviation.
Table 9 presents the results of ablation experiments for the relation extraction model. MacBERT-Concat-RC achieved a higher F 1 score than MacBERT-CLS, demonstrating that explicit combination of head and tail entity representations enhances relation discrimination. With the introduction of the GNF mechanism, MacBERT-GNF-RC’s F 1 score further improved to 0.929, confirming the effectiveness of integrating entity representations with neighborhood-gated features in relation extraction tasks.

5. Knowledge Graph Construction and Application

The preceding section verifies the effectiveness of the proposed entity and relation extraction models. On this basis, this section organizes the extracted entities and relations into standardized triples, imports them into Neo4j, and further applies the constructed knowledge graph to KG-augmented alarm interpretation.

5.1. Graph Construction

After model evaluation, the trained MacBERT-GNF-CRF model was applied to the relay protection corpus to identify entity mentions. Entity pairs co-occurring within the same sentence were subsequently classified by MacBERT-GNF-RC. Pairs predicted as No Relation were discarded, while the remaining candidate triples were manually reviewed to correct erroneous entity or relation labels. After terminology normalization and entity fusion, 5642 validated entity instances and 5128 relation triples were retained and imported into Neo4j using Cypher statements.

5.2. Knowledge Graph-Augmented Alarm Question-Answering Prototype

After completing the knowledge graph construction, this paper developed an enhanced alarm Q&A prototype based on the knowledge graph. The prototype utilizes the relay protection knowledge graph in Neo4j as a structured knowledge source. Upon receiving an SOE alarm record or a natural language query, the system retrieves relevant graph nodes and their adjacency relationships based on alarm signals and protection terminology, returns evidence triples related to the alarm, and feeds these into a large language model as structured context to generate potential causes and inspection recommendations.
Compared to directly calling large language models, knowledge graph-enhanced Q&A addresses queries using a model constrained by structured evidence, reducing the risk of unfounded inferences and providing operations personnel with traceable relationship paths. The workflow of the KG-augmented alarm Q&A prototype is summarized in Figure 10.

5.3. Typical Alarm Case and Comparative Analysis

A 220 kV line protection alarm event was selected as a representative case study. This incident involved multiple SOE signals—including “abnormal secondary voltage on PT,” “distance protection lockout signal,” “zero-sequence overcurrent protection activation,” and “line protection device alarm”—and encompassed information from various systems such as the secondary voltage circuit, distance protection lockout logic, and zero-sequence overcurrent protection mechanisms, making it well-suited for multi-signal correlation analysis.
From the perspective of relay protection principles, an abnormal PT secondary voltage indicates that the voltage measurement supplied to the protection device may be unreliable. When voltage-circuit supervision or PT-disconnection logic detects such an abnormality, the distance protection function may be blocked to avoid incorrect operation caused by unreliable impedance calculation. Meanwhile, the startup of zero-sequence overcurrent protection indicates the presence of a zero-sequence current component and can serve as evidence of a possible ground fault; however, this signal alone is insufficient to confirm a primary-system fault. Therefore, the main suspected causes in this composite alarm include PT secondary-circuit disconnection or abnormal voltage sampling, while the possibility of a primary ground fault should be further verified using fault waveforms and zero-sequence current records.
To ensure comparability, this study employs the DeepSeek-V3.2 model via the DeepSeek API, implementing two input approaches: direct question-answering and knowledge graph-enhanced question-answering. The former uses only alarm text as input, while the latter incorporates graph triples retrieved from Neo4j alongside the same alarm text. Both methods employ identical models, question formulations, and default API configurations, differing solely in whether graph evidence is provided. Both approaches require the model to identify the most probable cause and prioritize inspection items. This comparison represents a case study rather than a large-scale performance evaluation of question-answering systems, primarily aimed at assessing how graph triples enhance traceability in alarm explanations.
Table 10 presents the key KG evidence obtained from analysis in this case. The relevant triples establish connections between alarm signals and various parameters, including voltage circuit monitoring, distance protection, PT open-circuit lockout elements, lockout logic, and zero-sequence overcurrent protection. Specifically, triples related to PT secondary voltage anomalies and distance protection support troubleshooting of the secondary circuitry and lockout logic, while the activation of zero-sequence overcurrent protection serves as an auxiliary indicator for identifying primary ground faults.
Under identical alarm input conditions, when the large language model is directly invoked, it can provide reasonable diagnoses such as PT secondary circuit faults or open circuits, and recommend checking the PT secondary fuse, secondary wiring, grounding status, and distance protection PT lockout settings. However, this response primarily relies on the model’s general domain knowledge without providing clear structured evidence support, particularly lacking traceable justification for its diagnosis of primary ground faults.
In contrast, the knowledge graph-enhanced question-answering approach first returns the graph triple evidence shown in Table 10, linking information such as PT secondary voltage anomalies, line protection device alarms, distance protection lockout, and zero-sequence overcurrent protection activation. Based on these structured pieces of evidence, the model identifies the primary suspected causes as PT secondary circuit abnormalities, secondary-circuit disconnection, or voltage sampling errors, recommending priority inspection of the PT secondary circuit and distance protection lockout status; for zero-sequence overcurrent protection activation, it serves as an auxiliary diagnostic clue, suggesting that the presence of a primary ground fault should be further determined by combining fault waveforms and zero-sequence current records rather than treating it as a definitive conclusion.
This case demonstrates that KG-enhanced Q&A improves the traceability of alarm explanations by leveraging structured evidence chains, distinguishes between primary causes and supporting clues, reduces unfounded inferences, and generates inspection recommendations more aligned with actual operational workflows.
This representative 220 kV alarm event was also included as Case 09 in the 50-case expert evaluation described in Section 5.4. For this case, the average scores assigned by the three experts to the direct LLM response were 3.67, 3.00, 3.33, and 3.33 for cause correctness, evidence traceability, inspection practicality, and overall reliability, respectively. The corresponding KG-augmented response achieved average scores of 4.67, 4.33, 4.67, and 4.33, respectively. These case-level results are consistent with the overall trend observed in the 50-case evaluation and further illustrate the benefit of incorporating structured graph evidence into alarm interpretation.

5.4. Small-Scale Expert Evaluation

To provide a preliminary quantitative evaluation of the KG-augmented Q&A prototype, 50 representative composite alarm cases were selected from historical alarm records. Three experts with relay protection backgrounds independently evaluated the outputs generated by direct LLM question-answering and KG-augmented question-answering. Each answer was scored on a five-point scale in terms of cause correctness, evidence traceability, inspection practicality, and overall reliability. The average evaluation results are shown in Table 11.
The KG-augmented approach achieved higher scores across all four evaluation dimensions, with the most evident improvement observed in evidence traceability. For each case and evaluation metric, the ratings of the three experts were averaged, and two-sided paired t -tests were then conducted across the 50 case-level mean scores. The results showed that the KG-augmented approach significantly outperformed the direct LLM approach across all four evaluation metrics (all p < 0.001). To further assess the consistency of the expert ratings, inter-rater reliability was evaluated using Fleiss’ kappa separately for each evaluation metric and each answering approach. For the calculation, the five score levels were treated as discrete rating categories. Let N denote the number of evaluated cases, n   the number of experts, k the number of rating categories, and n i j the number of experts assigning case i to category j . In this study, N = 50, n = 3, and k = 5.
P i = 1 n ( n 1 ) j = 1 k n i j n i j 1 ,   P ¯ = 1 N i = 1 N P i
p j = 1 N n i = 1 N n i j ,   P ¯ e = j = 1 k p j 2
κ = P ¯ P ¯ e 1 P ¯ e
Here, P i denotes the observed agreement for case i , P ¯ is the mean observed agreement across all cases, p j is the overall proportion of ratings assigned to category j , and P ¯ e is the agreement expected by chance. Fleiss’ kappa therefore normalizes the observed agreement relative to chance agreement, with κ = 1 indicating perfect agreement and κ = 0 indicating agreement at the chance level. The resulting coefficients are shown in Table 12.
The Fleiss’ kappa coefficients ranged from 0.507 to 0.684 for the direct LLM approach and from 0.503 to 0.796 for the KG-augmented approach across the four evaluation dimensions, indicating generally moderate to substantial agreement among the three experts. It should be emphasized that Fleiss’ kappa measures inter-rater agreement rather than system performance; therefore, differences in kappa between the two approaches do not directly indicate differences in answer quality. Combined with the consistently higher mean scores reported in Table 11 and the statistically significant paired comparisons, these results support the reliability of the expert evaluation and indicate that structured graph evidence improves the evidential basis of generated answers, alarm interpretation, and inspection recommendations.

6. Discussion

The experimental results indicate that the GNF mechanism is effective for extracting relay protection knowledge. Compared with MacBERT-CRF and MacBERT-BiLSTM-CRF, MacBERT-GNF-CRF achieved higher and more stable recognition performance. The ablation results further show that neighborhood information, gated fusion, CRF decoding, and LayerNorm jointly contribute to entity boundary identification. This suggests that adaptively integrating adjacent semantic units is beneficial for recognizing long and compositionally complex relay protection terms.
The improvement in MacBERT-GNF-RC demonstrates that neighborhood-enhanced entity representations are also useful for relation classification. At the application level, the knowledge graph provides explicit relation paths connecting alarm signals, protection functions, functional components, and setting information. The expert evaluation shows that KG augmentation produces the greatest improvement in evidence traceability while also improving cause correctness and inspection practicality. Therefore, the main value of the knowledge graph is to provide structured evidence constraints for alarm interpretation rather than merely support graph storage and visualization.
This study still has several limitations. First, the current relation extraction strategy generates candidate entity pairs only when the entities co-occur within the same sentence. This design helps reduce noisy candidate pairs and limits the search space, but semantic relations expressed across sentence boundaries cannot be directly captured. Future work will investigate document-level relation extraction by incorporating cross-sentence contextual representations, coreference information, and graph-based context aggregation. Second, the current corpus and relation schema cover a limited range of relay protection documents and four predefined relation types. In addition, the constructed graph mainly represents textual knowledge and does not yet incorporate fault waveforms or device event sequences. Future work will therefore expand the corpus and alarm cases and construct multimodal knowledge graphs integrating textual, waveform, and event-sequence information.

7. Conclusions

This paper proposes a method for constructing and applying a knowledge graph for relay protection operation and maintenance that incorporates a neighborhood gating mechanism. A domain model covering five types of entities and four semantic relationships was established. The proposed MacBERT-GNF-CRF and MacBERT-GNF-RC models achieved F 1 scores of 0.946 and 0.929, respectively, and the resulting knowledge graph provides a foundation for querying and structurally retrieving relay protection operation and maintenance knowledge.
In terms of application, this paper develops a knowledge graph-enhanced alarm Q&A prototype and analyzes it using a composite alarm from a 220 kV line protection system as an example. The results demonstrate that graph triples provide a traceable, structured evidence chain for alarm explanations generated by large language models, thereby supporting cause identification and diagnostic recommendations.
Although the preliminary expert evaluation supports the effectiveness of KG augmentation, the current evaluation scale remains limited, and the generated results are intended only to assist operational analysis. Future work will expand the corpus and authentic alarm dataset, evaluate additional large language models, and integrate fault waveforms, device event records, and textual knowledge into a multimodal knowledge graph.

Supplementary Materials

The following supporting information can be downloaded at https://www.mdpi.com/article/10.3390/electronics15173981/s1, reference implementations of the proposed MacBERT-GNF-CRF and MacBERT-GNF-RC models and anonymized data-format examples.

Author Contributions

Conceptualization, L.J. (Longxing Jin), H.H. and W.C.; methodology, L.J. (Longxing Jin) and H.H.; software, H.H.; validation, L.J. (Longxing Jin), L.J. (Luemou Ju), X.Z., Z.L. and T.W.; formal analysis, L.J. (Longxing Jin) and H.H.; investigation, L.J. (Luemou Ju), X.Z., Z.L. and T.W.; resources, L.J. (Longxing Jin) and W.C.; writing—original draft preparation, H.H.; writing—review and editing, L.J. (Longxing Jin) and W.C.; supervision, W.C.; project administration, L.J. (Longxing Jin) and W.C.; funding acquisition, L.J. (Longxing Jin). All authors have read and agreed to the published version of the manuscript.

Funding

This research was funded by Shenzhen Power Supply Bureau Co., Ltd. Science and Technology Project, grant number 090000KC24100090.

Data Availability Statement

The original data used in this study are available from the corresponding author upon reasonable request. Reference implementations of the proposed models and anonymized data-format examples are provided in the Supplementary Materials.

Conflicts of Interest

Authors Longxing Jin, Luemou Ju, Xu Zhang, Zhengfei Lu, and Tinghuang Wang are affiliated with Shenzhen Power Supply Bureau Co., Ltd. The remaining authors declare that the research was conducted in the absence of any commercial or financial relationships that could be construed as a potential conflict of interest.

Abbreviations

The following abbreviations are used in this manuscript:
AbbreviationDefinition
BIOBegin–Inside–Outside
CRFConditional Random Field
CLSClassification Token
GNFGated Neighbor Fusion
KGKnowledge Graph
LLMLarge Language Model
NERNamed Entity Recognition
Neo4jGraph database used for knowledge storage
O&MOperation and Maintenance
PTPotential Transformer
RAGRetrieval-Augmented Generation
RCRelation Classification
SOESequence of Events

References

  1. Haddadi, A.; Farantatos, E.; Kocar, I.; Karaagac, U. Impact of inverter based resources on system protection. Energies 2021, 14, 1050. [Google Scholar] [CrossRef] [Scilit]
  2. Quispe, J.C.; Orduña, E. Transmission line protection challenges influenced by inverter-based resources: A review. Prot. Control Mod. Power Syst. 2022, 7, 28. [Google Scholar] [CrossRef] [Scilit]
  3. C37.2-2022; IEEE Standard for Electrical Power System Device Function Numbers, Acronyms, and Contact Designations. IEEE: New York, NY, USA, 2022.
  4. International Electrotechnical Commission. Communication Networks and Systems for Power Utility Automation-Part 1-1: Introduction and Overview; IEC TR 61850-1-1:2026; International Electrotechnical Commission: Geneva, Switzerland, 2026. [Google Scholar]
  5. Hogan, A.; Blomqvist, E.; Cochez, M.; d’Amato, C.; de Melo, G.; Gutierrez, C.; Kirrane, S.; Labra Gayo, J.E.; Navigli, R.; Neumaier, S.; et al. Knowledge graphs. ACM Comput. Surv. 2021, 54, 71. [Google Scholar] [CrossRef] [Scilit]
  6. Ji, S.; Pan, S.; Cambria, E.; Marttinen, P.; Yu, P.S. A survey on knowledge graphs: Representation, acquisition, and applications. IEEE Trans. Neural Netw. Learn. Syst. 2022, 33, 494–514. [Google Scholar] [CrossRef] [Scilit]
  7. Cao, Y.; Tang, J.; Shi, S.; Cai, D.; Zhang, L.; Xiong, P. Fault diagnosis techniques for electrical distribution network based on artificial intelligence and signal processing: A review. Processes 2025, 13, 48. [Google Scholar] [CrossRef] [Scilit]
  8. Wang, F.; Hu, Z. A novel fault diagnosis and accurate localization method for a power system based on GraphSAGE algorithm. Electronics 2025, 14, 1219. [Google Scholar] [CrossRef] [Scilit]
  9. Huang, X.; Li, P.; Wang, Y.; Ren, X.; Zhao, Z.; Li, G. Knowledge graph-augmented ERNIE-CNN method for risk assessment in secondary power system operations. Energies 2025, 18, 2104. [Google Scholar] [CrossRef] [Scilit]
  10. Wei, Z.; Qu, S.; Zhao, L.; Shi, Q.; Zhang, C. A position- and similarity-aware named entity recognition model for power equipment maintenance work orders. Sensors 2025, 25, 2062. [Google Scholar] [CrossRef] [Scilit]
  11. Devlin, J.; Chang, M.-W.; Lee, K.; Toutanova, K. BERT: Pre-training of deep bidirectional transformers for language understanding. In Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long and Short Papers), Minneapolis, MN, USA, 2–7 June 2019; pp. 4171–4186. [Google Scholar] [CrossRef] [Scilit]
  12. Cui, Y.; Che, W.; Liu, T.; Qin, B.; Wang, S.; Hu, G. Revisiting pre-trained models for Chinese natural language processing. In Proceedings of the Association for Computational Linguistics: EMNLP 2020, Online, 16–20 November 2020; pp. 657–668. [Google Scholar] [CrossRef] [Scilit]
  13. Lample, G.; Ballesteros, M.; Subramanian, S.; Kawakami, K.; Dyer, C. Neural architectures for named entity recognition. In Proceedings of the 2016 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, San Diego, CA, USA, 12–17 June 2016; pp. 260–270. [Google Scholar] [CrossRef] [Scilit]
  14. Ma, X.; Hovy, E. End-to-end sequence labeling via bi-directional LSTM-CNNs-CRF. In Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics, Volume 1: Long Papers, Berlin, Germany, 7–12 August 2016; pp. 1064–1074. [Google Scholar] [CrossRef] [Scilit]
  15. Zeng, D.; Liu, K.; Lai, S.; Zhou, G.; Zhao, J. Relation classification via convolutional deep neural network. In Proceedings of the 25th International Conference on Computational Linguistics: Technical Papers, Dublin, Ireland, 23–29 August 2014; pp. 2335–2344. [Google Scholar]
  16. Zhou, P.; Shi, W.; Tian, J.; Qi, Z.; Li, B.; Hao, H.; Xu, B. Attention-based bidirectional long short-term memory networks for relation classification. In Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics, Volume 2: Short Papers, Berlin, Germany, 7–12 August 2016; pp. 207–212. [Google Scholar] [CrossRef] [Scilit]
  17. Lewis, P.; Perez, E.; Piktus, A.; Petroni, F.; Karpukhin, V.; Goyal, N.; Küttler, H.; Lewis, M.; Yih, W.; Rocktäschel, T.; et al. Retrieval-augmented generation for knowledge-intensive NLP tasks. Adv. Neural Inf. Process. Syst. 2020, 33, 9459–9474. [Google Scholar]
  18. Knollmeyer, S.; Caymazer, O.; Grossmann, D. Document GraphRAG: Knowledge graph enhanced retrieval augmented generation for document question answering within the manufacturing domain. Electronics 2025, 14, 2102. [Google Scholar] [CrossRef] [Scilit]
  19. Liu, Y.; Zhou, Y.; Liu, Y.; Xu, Z.; He, Y. Intelligent fault diagnosis for CNC through the integration of large language models and domain knowledge graphs. Engineering 2025, 53, 311–322. [Google Scholar] [CrossRef] [Scilit]
  20. Edge, D.; Trinh, H.; Cheng, N.; Bradley, J.; Chao, A.; Mody, A.; Truitt, S.; Larson, J. From local to global: A graph RAG approach to query-focused summarization. arXiv 2024, arXiv:2404.16130. [Google Scholar] [CrossRef] [Scilit]
  21. Feng, B.; Zhang, Y.W.; Tang, X.; Guo, C.X.; Wang, J.J.; Yang, Q.; Wang, H.F. Power equipment defect record text mining based on BiLSTM-attention neural network. Proc. CSEE 2020, 40, 1–10. [Google Scholar] [CrossRef]
  22. Su, J.; Murtadha, A.; Pan, S.; Hou, J.; Sun, J.; Huang, W.; Wen, B.; Liu, Y. Global Pointer: Novel efficient span-based approach for named entity recognition. arXiv 2022, arXiv:2208.03054. [Google Scholar] [CrossRef] [Scilit]
Figure 1. Knowledge graph construction framework for intelligent relay protection O&M. Arrows indicate the direction of data and knowledge flow.
Figure 1. Knowledge graph construction framework for intelligent relay protection O&M. Arrows indicate the direction of data and knowledge flow.
Electronics 15 03981 g001
Figure 2. Domain schema layer of the relay protection O&M knowledge graph.
Figure 2. Domain schema layer of the relay protection O&M knowledge graph.
Electronics 15 03981 g002
Figure 3. Architecture of the MacBERT-GNF-CRF model. Arrows indicate the direction of information flow, and different colors distinguish the main functional modules.
Figure 3. Architecture of the MacBERT-GNF-CRF model. Arrows indicate the direction of information flow, and different colors distinguish the main functional modules.
Electronics 15 03981 g003
Figure 4. Schematic diagram of the gated neighbor feature fusion mechanism. Arrows indicate the direction of feature flow, and different colors distinguish the main functional components.
Figure 4. Schematic diagram of the gated neighbor feature fusion mechanism. Arrows indicate the direction of feature flow, and different colors distinguish the main functional components.
Electronics 15 03981 g004
Figure 5. Architecture of the relation extraction model. Arrows indicate the direction of information flow, and different colors distinguish the main functional modules.
Figure 5. Architecture of the relation extraction model. Arrows indicate the direction of information flow, and different colors distinguish the main functional modules.
Electronics 15 03981 g005
Figure 6. Validation F1-score curves of the entity recognition models (results of a single representative run with the same random seed for all models).
Figure 6. Validation F1-score curves of the entity recognition models (results of a single representative run with the same random seed for all models).
Electronics 15 03981 g006
Figure 7. Entity-level confusion matrix of the MacBERT-GNF-CRF model.
Figure 7. Entity-level confusion matrix of the MacBERT-GNF-CRF model.
Electronics 15 03981 g007
Figure 8. Validation F1-score curves of the relation extraction models.
Figure 8. Validation F1-score curves of the relation extraction models.
Electronics 15 03981 g008
Figure 9. Confusion matrix of the MacBERT-GNF-RC model on the test set.
Figure 9. Confusion matrix of the MacBERT-GNF-RC model on the test set.
Electronics 15 03981 g009
Figure 10. Relay protection alarm analysis process based on the knowledge graph. Arrows indicate the direction of information flow, and different colors distinguish the main processing stages.
Figure 10. Relay protection alarm analysis process based on the knowledge graph. Arrows indicate the direction of information flow, and different colors distinguish the main processing stages.
Electronics 15 03981 g010
Table 1. Examples of entity annotation.
Table 1. Examples of entity annotation.
Sample TextLabel
bus differential protectionB-Protection Function I-Protection Function I-Protection Function
GIS busbarB-Primary Equipment I-Primary Equipment
current threshold settingB-Setting Parameter I-Setting Parameter I-Setting Parameter
Table 2. Statistics of annotated entity types.
Table 2. Statistics of annotated entity types.
Label CategoryTrainingValidationTestTotal
Primary Equipment55456936936931
Protection Function11,1061388138813,882
Functional Component74029259259252
Setting Parameter66618338328326
Secondary Circuit Signal62907867877863
Outside (O)30,2763784378437,844
Total67,2808409840984,098
Table 3. Distribution of relation classification instances in the dataset.
Table 3. Distribution of relation classification instances in the dataset.
Relation LabelTrainingValidationTestTotal
triggers9241151151154
contains12831601601603
depends on11281411411410
linked to17952252252245
No Relation25643213213206
Total76949629629618
Table 4. Training parameters of the MacBERT-GNF-CRF model.
Table 4. Training parameters of the MacBERT-GNF-CRF model.
Training ParameterValue
Epoch20
Batch size8
Learning rate2 × 10−5
Dropout rate0.1
Max length512
Weight decay0.01
Warmup ratio0.1
Table 5. Experimental results of different entity recognition models over five independent runs.
Table 5. Experimental results of different entity recognition models over five independent runs.
ModelPrecisionRecall F 1 -Score
BiLSTM-CRF0.863 ± 0.0040.874 ± 0.0050.868 ± 0.004
MacBERT-CRF0.914 ± 0.0020.919 ± 0.0030.916 ± 0.002
MacBERT-BiLSTM-CRF0.923 ± 0.0020.928 ± 0.0030.925 ± 0.002
MacBERT-GlobalPointer0.934 ± 0.0010.927 ± 0.0020.931 ± 0.001
MacBERT-GNF-CRF0.944 ± 0.0020.948 ± 0.0020.946 ± 0.002
Table 6. Ablation study of the MacBERT-GNF-CRF model for entity recognition.
Table 6. Ablation study of the MacBERT-GNF-CRF model for entity recognition.
ModelPrecisionRecall F 1 -Score
MacBERT-CRF0.914 ± 0.0050.919 ± 0.0040.916 ± 0.004
MacBERT-Concat-CRF0.934 ± 0.0030.938 ± 0.0040.936 ± 0.003
MacBERT-GNF-Softmax0.937 ± 0.0020.927 ± 0.0020.932 ± 0.002
MacBERT-GNF-CRF w/o LN0.939 ± 0.0040.942 ± 0.0030.940 ± 0.003
MacBERT-GNF-CRF0.944 ± 0.0010.948 ± 0.0020.946 ± 0.001
Table 7. Training parameters of the relation extraction model.
Table 7. Training parameters of the relation extraction model.
ParameterValue
Epoch20
Batch size32
Learning rate3 × 10−5
Max length128
Dropout rate0.1
Class num5
Table 8. Experimental results of the relation classification models over five independent runs.
Table 8. Experimental results of the relation classification models over five independent runs.
ModelPrecisionRecall F 1 -Score
BiLSTM-Attention0.872 ± 0.0050.881 ± 0.0050.876 ± 0.004
MacBERT-CLS0.912 ± 0.0040.915 ± 0.0030.913 ± 0.003
MacBERT-GNF-RC0.928 ± 0.0020.931 ± 0.0030.929 ± 0.002
Table 9. Ablation study of the MacBERT-GNF-RC model for relation extraction.
Table 9. Ablation study of the MacBERT-GNF-RC model for relation extraction.
ModelPrecisionRecall F 1 -Score
MacBERT-CLS0.912 ± 0.0020.915 ± 0.0010.913 ± 0.001
MacBERT-Concat-RC0.918 ± 0.0030.924 ± 0.0020.921 ± 0.003
MacBERT-GNF-RC0.928 ± 0.0020.931 ± 0.0020.929 ± 0.002
Table 10. Retrieved knowledge graph evidence for the typical alarm case.
Table 10. Retrieved knowledge graph evidence for the typical alarm case.
No.Retrieved KG TripleRole in Reasoning
1PT Secondary Voltage Abnormality—triggers—Voltage Circuit SupervisionIdentifies the voltage circuit abnormality as the main entry point of the event.
2Line Protection Device Alarm—linked to—Voltage Circuit SupervisionIndicates that the device alarm is associated with voltage circuit supervision.
3Distance Protection Blocking Signal—linked to—Distance ProtectionLinks the blocking signal to the affected protection function.
4Distance Protection—contains—PT Disconnection Blocking ElementExplains why PT abnormality may lead to distance protection blocking.
5Distance Protection—depends on—PT Disconnection Blocking LogicSupports checking the blocking logic and PT secondary circuit.
6Zero-sequence Overcurrent Startup—triggers—Zero-sequence Overcurrent ProtectionProvides auxiliary evidence for checking whether a primary grounding fault exists.
Table 11. Expert evaluation of direct and KG-augmented question-answering.
Table 11. Expert evaluation of direct and KG-augmented question-answering.
Evaluation MetricDirect LLMKG-Augmented LLM
Cause Correctness3.784.31
Evidence Traceability2.674.58
Inspection Practicality3.734.29
Overall Reliability3.494.38
Table 12. Inter-rater agreement measured by Fleiss’ kappa.
Table 12. Inter-rater agreement measured by Fleiss’ kappa.
Evaluation MetricDirect LLMKG-Augmented LLM
Cause Correctness0.5070.771
Evidence Traceability0.6840.503
Inspection Practicality0.6830.668
Overall Reliability0.6380.796
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Jin, L.; Hou, H.; Ju, L.; Zhang, X.; Lu, Z.; Wang, T.; Chen, W. A Gated Neighbor Fusion-Based Knowledge Graph for Relay Protection Operation and Maintenance. Electronics 2026, 15, 3981. https://doi.org/10.3390/electronics15173981

AMA Style

Jin L, Hou H, Ju L, Zhang X, Lu Z, Wang T, Chen W. A Gated Neighbor Fusion-Based Knowledge Graph for Relay Protection Operation and Maintenance. Electronics. 2026; 15(17):3981. https://doi.org/10.3390/electronics15173981

Chicago/Turabian Style

Jin, Longxing, Haozhe Hou, Luemou Ju, Xu Zhang, Zhengfei Lu, Tinghuang Wang, and Wei Chen. 2026. "A Gated Neighbor Fusion-Based Knowledge Graph for Relay Protection Operation and Maintenance" Electronics 15, no. 17: 3981. https://doi.org/10.3390/electronics15173981

APA Style

Jin, L., Hou, H., Ju, L., Zhang, X., Lu, Z., Wang, T., & Chen, W. (2026). A Gated Neighbor Fusion-Based Knowledge Graph for Relay Protection Operation and Maintenance. Electronics, 15(17), 3981. https://doi.org/10.3390/electronics15173981

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop