Relay alarm signal knowledge joint extraction method fusing ALBERT and self-attention mechanism

By combining the ALBERT pre-training model and the self-attention mechanism, the problems of large parameter quantities and slow convergence speed in traditional methods are solved, and the extraction efficiency and accuracy of relay alarm signal knowledge are improved, especially when dealing with entities in complex power systems. In relation extraction, the ability to handle polysemy of a word is enhanced.

CN118569377APending Publication Date: 2024-08-30STATE GRID JIANGSU ELECTRIC POWER CO LTD +2

Patent Information

Application Number
CN202410680508.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-29
Publication Date
2024-08-30

AI Technical Summary

Technical Problem

When the traditional BERT pre-trained language model handles complex relay alarm signal knowledge, it has a large number of parameters and slow convergence speed, and the traditional pipeline-type entity relationship extraction method does not fully consider the correlation between the two sub-tasks, resulting in error accumulation. Moreover, relationship extraction only uses a single-layer self-attention mechanism on the semantic dimension of entities, which fails to fully solve the problem of polysemy.

Method used

Using the ALBERT pre-training model combined with the self-attention mechanism, the multi-layer self-attention mechanism is introduced to focus on the multi-level semantic information of characters in the relationship extraction stage. The entity recognition module uses self-attention to focus on the attention pairs between words, improving Accuracy of entity relationship extraction.

Benefits of technology

It saves time and space resource overhead, improves model convergence speed, solves the problem of polysemy, improves the accuracy of entity relationship extraction, and enhances the efficiency and accuracy of knowledge extraction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118569377A
    Figure CN118569377A
Patent Text Reader

Abstract

The invention discloses a relay alarm signal knowledge joint extraction method fusing ALBERT and a self-attention mechanism, and the method comprises the following steps: S1, inputting an input text into an ALBERT pre-training language model, and obtaining an input text dynamic vector; s2, by introducing a BiLSTM neural network sharing a basic parameter structure, performing depth sequence feature extraction on a text dynamic vector obtained by an ALBERT layer; s3, the entity recognition module introduces a self-attention mechanism to pay attention to the influence of attention between words in the text sequence on a sequence marking result; and S4, carrying out relay protection alarm signal relation extraction based on Multilevel-Attention (Multilevel-Attention). According to the relay alarm signal knowledge joint extraction method fusing the ALBERT and the self-attention mechanism, the ALBERT model is introduced to dynamically encode the text, and the BiLSTM is used as a shared parameter layer for deep sequence feature extraction; the entity recognition module and the relation recognition module respectively introduce a self-attention mechanism and a multi-layer self-attention mechanism to enhance the recognition accuracy of entities and relations.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of knowledge extraction technology, and in particular to a method for jointly extracting relay alarm signal knowledge by integrating ALBERT and a self-attention mechanism. Background Art

[0002] Relay protection is an important technology in the power system, which is used to detect and isolate faults in the power system in a timely manner and protect the safe operation of equipment and systems. The relay protection system monitors the voltage, current, frequency and other parameters in the power system, and compares them with the preset protection logic to issue corresponding alarm signals or perform corresponding actions. The knowledge of these alarm signals often comes from many sources, exists in various forms and is highly professional. How to extract this knowledge efficiently and accurately after data preprocessing is crucial for the subsequent use of entity relationship triples to build a high-quality knowledge graph. At present, many scholars have conducted knowledge extraction research on massive and complex data in the power field based on deep learning and natural language processing technology. They introduced a bidirectional long short-term memory network based on conditional random fields to deal with the complex power entity extraction task, as traditional methods and supervised learning methods are difficult to cope with. In view of the high dimensionality of the features of power equipment defect text, a convolutional neural network was introduced for entity mining, and feature dimensionality reduction was achieved through convolution operations, greatly reducing the amount of calculations. In order to increase the accuracy of entity extraction, the BERT pre-training model was introduced for power entities, but it has high requirements for computer hardware resources and requires large computing resources. For entity relationship extraction, pipeline methods are also often used. Although good results have been achieved, the correlation between the two subtasks has not been fully considered, and the entity recognition information has not been fully integrated in the relationship extraction stage. In addition, in previous relationship extraction research, one-dimensional self-attention vectors are often used to measure the relationship weights between entities, and the extraction of relationships is not considered from the multi-level semantic level of characters. This does not fully solve the problem of polysemy. From the perspective of logical technology, the shortcomings of existing technical research are summarized as follows:

[0003] The traditional BERT pre-trained language model has millions of parameters, requires too much computing power, and has a slow convergence speed. It still needs to be improved in dealing with professional, complex, and large-volume relay alarm signal knowledge. The traditional pipeline-style entity relationship extraction method does not fully consider the correlation between the two subtasks, and there is an error accumulation problem.

[0004] Traditional knowledge joint extraction methods fail to fully integrate entity recognition information in the relation extraction stage, and in relation extraction, most of them use a single-layer self-attention mechanism on one semantic dimension of the entity to measure the relationship between entities. Summary of the invention

[0005] The purpose of the present invention is to provide a joint knowledge extraction method for relay alarm signals that integrates ALBERT and self-attention mechanism, and proposes a set of multi-entity relationship joint extraction models that integrate ALBERT and self-attention mechanism. By introducing the ALBERT pre-training model, it not only saves time and space resource overhead and improves the model convergence speed, but also solves the polysemy problem to a certain extent. The self-attention mechanism is introduced in the joint knowledge extraction stage, in which the self-attention of the entity recognition module focuses more on the influence of the attention between words in the text sequence on the sequence labeling results. The relationship extraction module introduces a multi-layer self-attention mechanism to pay attention to the semantic information weight of each character in a sentence at different levels, thereby improving the accuracy of entity relationship extraction.

[0006] To achieve the above objectives, the present invention provides a method for jointly extracting knowledge of relay alarm signals by integrating ALBERT and self-attention mechanism, comprising the following steps:

[0007] S1. For the input text, input it into the ALBERT pre-trained language model to obtain the input text dynamic vector;

[0008] S2. By introducing the BiLSTM neural network with a shared basic parameter structure, the text dynamic vector obtained by the ALBERT layer is subjected to deep sequence feature extraction;

[0009] S3, the entity recognition module introduces a self-attention mechanism to focus on the influence of attention between words in the text sequence on the sequence labeling results;

[0010] S4. Relay protection alarm signal relationship extraction based on Multilevel-Attention.

[0011] Preferably, in step S1, an ALBERT pre-trained model is used to represent various entity relationship information by word embedding, and the ALBERT pre-trained model factorizes word embedding;

[0012] For an input text, the embedding layer is responsible for converting its text vector into a word vector, a segment vector, and a position vector. The word vector represents the semantics of a single word, the segment vector represents the contextual semantics, and the position vector represents the location information.

[0013] The dual Transformer encoder uses the self-attention mechanism to fuse the contextual information to model the input text.

[0014] Preferably, in step S2, the BiLSTM neural network is composed of two layers of reverse LSTM units;

[0015] The various input sequence vectors v=[v1,v2,...,vn ] as the input of each time step of the bidirectional LSTM, and obtain the output of the forward and reverse LSTM hidden layer sequences;

[0016] The hidden sequence obtained by the bidirectional LSTM is spliced ​​bit by bit to obtain the complete hidden sequence output H of BiLSTM, in which a single word contains richer context feature information.

[0017] Preferably, in step S3, the output H of the BiLSTM hidden layer sequence is subjected to the linear layer, the self-attention layer, the output layer and the CRF layer conditional random field to obtain the entity label prediction result of the text sequence. The linear layer is responsible for performing three linear transformations on the output H of the BiLSTM module to obtain the corresponding initialization matrix, and send it to the self-attention layer. The function of this layer is to obtain the attention weight matrix representing the mutual influence between words in the input sequence, and then send the obtained weight matrix to the output layer to obtain the entity label score vector corresponding to each word in the sentence.

[0018] Preferably, in step S4, in order to achieve warning signal relationship type prediction, a multi-layer self-attention mechanism is used in relationship extraction to classify the relationship type.

[0019] The present invention is a joint knowledge extraction method for relay alarm signals that integrates ALBERT and self-attention mechanism, and proposes a set of multi-entity relationship joint extraction models that integrate ALBERT and self-attention mechanism. By introducing the ALBERT pre-training model, it not only saves time and space resource overhead and improves the model convergence speed, but also solves the polysemy problem to a certain extent. The self-attention mechanism is introduced in the joint knowledge extraction stage, in which the self-attention of the entity recognition module focuses more on the influence of the attention between words in the text sequence on the sequence labeling results. The relationship extraction module introduces a multi-layer self-attention mechanism to pay attention to the semantic information weight of each character in a sentence at different levels, thereby improving the accuracy of entity relationship extraction.

[0020] The technical solution of the present invention is further described in detail below through the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] Figure 1 This is an ALBERT pre-trained language model architecture diagram of an embodiment of a method for jointly extracting knowledge of relay alarm signals by integrating ALBERT and a self-attention mechanism in the present invention;

[0022] Figure 2 This is a BiLSTM structure diagram of an embodiment of a method for jointly extracting knowledge of relay alarm signals by integrating ALBERT and self-attention mechanism of the present invention;

[0023] Figure 3The average loss function of the model training for the embodiment of the relay alarm signal knowledge joint extraction method integrating ALBERT and self-attention mechanism of the present invention;

[0024] Figure 4 The present invention provides an embodiment of a method for jointly extracting knowledge of relay alarm signals by integrating ALBERT and self-attention mechanism, which is a model for jointly extracting knowledge of relay alarm signals by integrating ALBERT and self-attention mechanism. DETAILED DESCRIPTION

[0025] The technical solution of the present invention is further described below through the accompanying drawings and embodiments.

[0026] Unless otherwise defined, technical or scientific terms used in the present invention shall have the common meanings understood by one having ordinary skills in the field to which the present invention belongs.

[0027] Embodiment 1

[0028] like Figure 1-4 As shown in S1, for the input text, input it into the ALBERT pre-trained language model to obtain the dynamic vector of the input text. Using the ALBERT pre-trained model, various entity relationship information is represented by word embedding, thereby realizing the deep mining of relay alarm signal knowledge. The model architecture is as follows Figure 1 As shown in the figure, as a lightweight pre-trained language model, while ensuring the performance of the BERT model, the ALBERT model factorizes word embeddings by first mapping the one-hot vocabulary of size V to a low-dimensional vector space E, and then mapping it to the hidden layer space of size H. In this way, the number of parameters changes from O(V*H) to O(V*E+E*H). When H is much larger than E, the number of parameters is significantly reduced, thereby greatly improving the model training speed.

[0029] The ALBERT pre-trained model is used to represent various entity relationship information through word embedding. The ALBERT pre-trained model factorizes word embedding.

[0030] For an input text, the embedding layer is responsible for converting its text vector into a word vector, a segment vector, and a position vector. The word vector represents the semantics of a single word, the segment vector represents the contextual semantics, and the position vector represents the location information.

[0031] The dual Transformer encoder uses the self-attention mechanism to fuse the contextual information to model the input text.

[0032] For an input word, the embedding layer is responsible for converting its text vector into a word vector, a segment vector, and a position vector, which are used to represent the semantics of a single word, the contextual semantics, and the location information respectively; the dual Transformer encoder fuses the contextual information based on the self-attention mechanism to model the text, as shown in formula (1).

[0033]

[0034] In the formula, Q, K, V are the input word vector matrices, d k is the input vector dimension. This formula reflects the importance of different words to a certain extent, and each word vector contains the information of all word vectors in the same sentence, which is compatible with the polysemy problem.

[0035] S2. The input text dynamic vector is responsible for extracting deep sequence features by introducing a BiLSTM neural network with a shared basic parameter structure, and the output results of the two are concatenated to obtain the final sequence features.

[0036] The BiLSTM neural network consists of two layers of reverse LSTM units;

[0037] The various input sequence vectors v=[v1,v2,...,v n ] as the input of each time step of the bidirectional LSTM, and obtain the output of the forward and reverse LSTM hidden layer sequences;

[0038] The hidden layer sequence obtained by the bidirectional LSTM is concatenated bit by bit to obtain the complete hidden layer sequence output H of the BiLSTM.

[0039] Various input sequence vectors v = [v1, v2, ..., vn] encoded by the ALBERT layer are used as the input of each time step of the bidirectional LSTM to obtain the output Hfor and Hopp of the forward and reverse LSTM hidden layer sequences.

[0040] H for =[h for(1) ,h for(2) ,...,h for(n-1) ,h for(n) ]∈R n×m (2)

[0041] H opp =[h opp(1) ,h opp(2) ,...,h opp(n-1) ,h opp(n) ]∈R n×m (3)

[0042] Where: hfor(i) and hopp(i) represent the i-th text character of the forward and reverse input respectively; m represents the dimensions of hfor(i) and hopp(i).

[0043] The hidden layer sequence obtained by the bidirectional LSTM is concatenated bit by bit to obtain the complete hidden layer sequence output H of the BiLSTM, as shown in formula (4).

[0044] H=[h for(1) :h opp(1) ,h for(2) :h opp(2) ,...,h for(n-1) :h opp(n-1) ,h for(n) :h opp(n) ]∈R n×m (4)

[0045] Where hfor(i):hopp(i) means concatenating the m-dimensional vectors of the i-th forward and reverse hidden layers into a vector of dimension 2m.

[0046] S3. The entity recognition module introduces the self-attention mechanism to focus more on the impact of attention between words in the text sequence on the sequence labeling results.

[0047] The input is the output H of the BiLSTM hidden layer sequence. A single word contains richer context feature information. After the linear layer, self-attention layer, output layer and CRF layer (conditional random field), the entity label prediction result of the text sequence is obtained;

[0048] The linear layer is responsible for performing three linear transformations on the output H of the BiLSTM module to obtain the corresponding initialization matrix and send it to the self-attention layer. The function of this layer is to obtain the attention weight matrix representing the mutual influence between words in the input sequence. The obtained weight matrix is ​​then sent to the output layer to obtain the entity label score vector corresponding to each word in the sentence.

[0049] In order to achieve label prediction of warning signal entities, CRF (Conditional Random Field) is used to classify entity types in entity extraction.

[0050] When performing entity recognition on text related to relay protection alarm signals, the self-attention mechanism is introduced to focus more on the influence of attention between words in the text sequence on the sequence labeling results. The input of this module is the output H of the BiLSTM hidden layer sequence. A single word contains richer context feature information. After the linear layer, self-attention layer, output layer and CRF layer (conditional random field), the entity label prediction result of the text sequence is obtained.

[0051] The linear layer is responsible for performing three linear transformations on the output H of the BiLSTM module to obtain three matrices Q, K and V, as shown in formula (5):

[0052]

[0053] Where dim is the vector representation dimension of each word in the BiLSTM module output H, and Wq, Wk, Wv are the corresponding linear transformation parameters.

[0054] After obtaining the three initialization matrices Q, K, and V, they are sent to the self-attention layer, which is used to obtain the attention weight matrix representing the mutual influence between words in the input sequence, as shown in formula (6). The obtained weight matrix is ​​then sent to the output layer to obtain the entity label score vector l corresponding to each word in the sentence, as shown in formula (7).

[0055]

[0056] l = tanh(MW l +b l ),W l ∈R dim*tagnum ,b l ∈R tagnum (7)

[0057] Where dk is the square root of the dimension of K, which is a standard scale set to prevent the inner product from being too large, M is the attention weight matrix obtained from the upper layer, Wl is the weight parameter of M, bl is the bias parameter, tanh is the activation function, and tagnum is the total number of tags.

[0058] In order to achieve label prediction of alarm signal entities, CRF (conditional random field) is used to classify entity types in entity extraction. The text feature vector matrix yn obtained after ALBERT pre-trained language model and BiLSTM feature extraction is used as the input of CRF to mark entity labels. It is assumed that the alarm signal data is regarded as an observation sequence Y (y1, y2, y3, ..., yn), and each word in the observation sequence corresponds to an entity label L (l1, l2, l3, ..., ln). P (L|Y) is the conditional probability distribution of the label sequence L when the observation sequence Y is known. Therefore, when the input observation sequence Y is given, we use the CRF model to score the sentence sequence to find the most likely entity label sequence L, as shown in formula (8).

[0059]

[0060] In the formula, Yi,li represents the score of word yi being classified into label li, lli-1,li represents the label score transfer matrix between the li-1th entity node and the lith entity node. When we predict the label of a word, we can use the previous label learned by the model. From formula (8), it can be seen that the score value of the entire sequence is the sum of the score values ​​of each position. Finally, the prediction probability of the entire sequence is obtained through normalization operation, as shown in formula (9).

[0061]

[0062] In the formula, l' represents any label sequence of the input length, and the set with the largest probability is finally selected as the final label sequence of the CRF layer, and the output y represents the entity label corresponding to the input word vector.

[0063] S4. Relay protection alarm signal relationship extraction based on Multilevel-Attention.

[0064] The input of this module is the output of the BiLSTM module. After the entity feature merging layer, the multi-level attention layer and the output layer, the classification result of the relation instance is obtained. The entity feature merging layer adds the following two features to the output vector of the BiLSTM module:

[0065] Entity relative position feature: Two numerical values ​​are used to represent the distance between the current word and entity 1 and entity 2 in the entity pair. For example, in the sentence "When the device detects a short circuit, it will send a protection action signal", for the entity pair <short circuit, protection action>, the relative entity position feature value of each word is shown in Table 1.

[0066] Table 1 Relative entity position distance

[0067]

[0068] (2) Entity type features: For example, in the entity pair <short circuit, protection action>, “short circuit” and “protection action” represent the fault type and the type of signal issued, respectively, and the entity type feature vector will indicate this.

[0069] The entity feature merging layer embeds the two features of relative entity position and entity type respectively to obtain the vector representation of the merged features, and concatenates the feature vector with the output ht of the BiLSTM module to obtain the vector ωt corresponding to the character at time t.

[0070] ω t =[h t ,pos1_emb,pos2_emb,entitytype1_emb,entitytype2_emb] (10)

[0071] The multi-level attention layer introduces a multi-layer self-attention mechanism into the output of the feature merging layer, which is mathematically represented as a weight matrix α, calculated by the sentence representation matrix W and weight parameters S1 and S2:

[0072] W=[W1,W2,...,W n ],W∈R n×dim (11)

[0073] α=softmax(tanh(WS1)S2),S1∈R dim×d ,S2∈R dim×L (12)

[0074] Where n is the length of the sentence, d and L are hyperparameters, the dimension of α is n*L, and L represents how many levels of information are extracted for each character in the sentence to obtain weight information. Therefore, each row in α represents the weight information of the corresponding character at L levels. Then the representation matrix W of the original sentence is multiplied by the weight matrix α to obtain the sentence feature vector H.

[0075] H = tanh(W T α),H∈R dim*L (13)

[0076] Finally, the output layer outputs the predicted relationship classification label y'.

[0077]

[0078] Where Wh is the weight parameter of H and bh is the offset parameter.

[0079] Therefore, the present invention adopts the above-mentioned relay alarm signal knowledge joint extraction method integrating ALBERT and self-attention mechanism.

[0080] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that they can still modify or replace the technical solution of the present invention with equivalents, and these modifications or equivalent replacements cannot cause the modified technical solution to deviate from the spirit and scope of the technical solution of the present invention.

Claims

1. A joint knowledge extraction method for relay alarm signals integrating ALBERT and self-attention mechanism, characterized by: S1. For the input text, input it into the ALBERT pre-trained language model to obtain the input text dynamic vector; S2. By introducing the BiLSTM neural network with a shared basic parameter structure, the text dynamic vector obtained by the ALBERT layer is subjected to deep sequence feature extraction; S3, the entity recognition module introduces a self-attention mechanism to focus on the influence of attention between words in the text sequence on the sequence labeling results; S4. Relay protection alarm signal relationship extraction based on Multilevel-Attention.

2. According to claim 1, the method for jointly extracting knowledge of relay alarm signals integrating ALBERT and self-attention mechanism is characterized by: In step S1, the ALBERT pre-trained model is used to represent various entity relationship information by word embedding. The ALBERT pre-trained model factorizes the word embedding; For an input text, the embedding layer is responsible for converting its text vector into a word vector, a segment vector, and a position vector. The word vector represents the semantics of a single word, the segment vector represents the contextual semantics, and the position vector represents the location information. The dual Transformer encoder uses the self-attention mechanism to fuse the contextual information to model the input text.

3. The method for jointly extracting knowledge of relay alarm signals integrating ALBERT and self-attention mechanism according to claim 1 is characterized in that: In step S2, the BiLSTM neural network consists of two layers of reverse LSTM units; The various input sequence vectors v=[v1,v2,...,v n ] as the input of each time step of the bidirectional LSTM, and obtain the output of the forward and reverse LSTM hidden layer sequences; The hidden sequence obtained by the bidirectional LSTM is spliced ​​bit by bit to obtain the complete hidden sequence output H of BiLSTM, in which a single word contains richer context feature information.

4. The method for jointly extracting knowledge of relay alarm signals integrating ALBERT and self-attention mechanism according to claim 1 is characterized in that: In step S3, the output H of the BiLSTM hidden layer sequence is passed through the linear layer, self-attention layer, output layer and CRF layer conditional random field to obtain the entity label prediction result of the text sequence. The linear layer is responsible for performing three linear transformations on the output H of the BiLSTM module to obtain the corresponding initialization matrix, and send it to the self-attention layer. The function of this layer is to obtain the attention weight matrix representing the mutual influence between words in the input sequence, and then send the obtained weight matrix to the output layer to obtain the entity label score vector corresponding to each word in the sentence.

5. The method for jointly extracting knowledge of relay alarm signals integrating ALBERT and self-attention mechanism according to claim 1 is characterized in that: In step S4, in order to predict the relationship type of the alarm signal, a multi-layer self-attention mechanism is used in the relationship extraction to classify the relationship type.

Citation Information

Patent Citations

  • Chinese entity relationship joint extraction method

    CN113128229A

  • Joint extraction method for named entities and relationships in judicial domain

    CN113221567A

  • Entity relation joint extraction method based on entity-to-attention mechanism

    CN115062109A

  • Power transformation main equipment knowledge joint extraction method fusing ALBERT and entity segmentation algorithm, storage medium, electronic equipment and application

    CN116501894A

  • RoBERTa-BiLSTM-CRF voice dialogue text named entity recognition system fused with attention mechanism

    CN117010387A

Cited By

  • Entity extraction method and device based on adaptive weight fusion

    CN120632111A

  • An entity extraction method and device based on adaptive weight fusion

    CN120632111B

  • Electric power transaction knowledge extraction method based on semantic coding and feature enhancement

    CN121543593A