Method, device, equipment and storage medium for processing defect information of electric power equipment
Through improved BILSTM and BERT algorithms, the defect text of power equipment is processed and the knowledge graph is built, which solves the heterogeneity, diversity and fragmentation problems in the management of power equipment defect text, and improves the comprehensiveness and reliability of knowledge management.
Patent Information
- Application Number
- CN202210695552.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-17
- Publication Date
- 2025-02-18
- Estimated Expiration
- 2042-06-17
AI Technical Summary
The prior art is unable to effectively deal with the heterogeneity, diversity and fragmentation characteristics in the text of power equipment defects, resulting in incomplete and unreliable knowledge management.
The improved BILSTM algorithm is used to text enhance the structured text information, and the improved BERT algorithm is used to physically extract the unstructured text information to build a knowledge graph of power equipment defects.
The quality of defective text and the content quality of the knowledge graph are improved, and effective information extraction and knowledge management of defective texts of power equipment with heterogeneity, diversity and fragmentation characteristics are realized.
Smart Images

Figure CN115048492B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of power equipment operation and maintenance technology, and in particular to a method, device, equipment and storage medium for processing power equipment defect information. Background Art
[0002] After a power equipment failure occurs, the defects of the power equipment are usually quickly identified and eliminated in time to ensure the reliability of the power system. To facilitate subsequent fault identification and elimination, the power equipment defect information is recorded in text form, which contains key information such as fault problem description and fault cause analysis, and contains rich experience and knowledge related to the operation and maintenance of power equipment.
[0003] At present, due to the strong domain-specificity of power equipment defect texts and the fact that they are manually recorded, their expressions do not conform to universal grammar. They are long, have complex syntactic structures, and are difficult to accurately divide into subject and predicate components of the text. In addition, the types of entities to be extracted are diverse, including not only word phrase types, but also specific types of sentences. Therefore, knowledge management of power equipment defect texts is required. However, current knowledge management work is mainly based on large traditional text datasets with clear grammatical structures, which cannot be applied to power equipment defect texts with characteristics such as heterogeneity, diversity, and fragmentation. Therefore, a processing method suitable for power equipment defect information is urgently needed. Summary of the invention
[0004] The present invention provides a method, device, equipment and storage medium for processing defect information of electric power equipment, so as to solve the technical problem that the current knowledge management mode cannot be applied to defect texts of electric power equipment.
[0005] In order to solve the above technical problems, in a first aspect, the present invention provides a method for processing defect information of electric power equipment, comprising:
[0006] Acquire power equipment defect information, the power equipment defect information includes structured text information and unstructured text information;
[0007] Use the preset improved BILSTM algorithm to perform text enhancement on structured text information to obtain the target structured text information;
[0008] Use the preset improved BERT algorithm to extract entities from unstructured text information and obtain target entity information;
[0009] Based on the target structured text information and target entity information, a knowledge graph of power equipment defects is constructed.
[0010] Preferably, the improved BILSTM algorithm includes a UCNN algorithm and a first BILSTM algorithm. The preset improved BILSTM algorithm is used to perform text enhancement on structured text information to obtain target structured text information, including:
[0011] Preprocessing the structured text information to obtain preprocessed structured text information, the preprocessing includes text segmentation, stop word removal and synonym replacement;
[0012] Using the UCNN algorithm, word features are extracted from the preprocessed structured text information to obtain word features of the preprocessed structured text information;
[0013] The first BILSTM algorithm is used to perform text classification on the preprocessed structured text information according to word features to obtain the target structured text information.
[0014] As a preference, the expression of the UCNN algorithm is:
[0015]
[0016] Among them, o(u,v) is the word feature, is a non-shared convolution kernel, w i,j for The weight value at (i, j) in K r×s Represents the word vector set corresponding to the preprocessed structured text information, k u-i,v-j K r×s The word vectors in .
[0017] Preferably, the improved BERT algorithm includes a BERT algorithm, a second BILSTM algorithm and a CRF algorithm. The preset improved BERT algorithm is used to perform entity extraction on unstructured text information to obtain target entity information, including:
[0018] Use the BERT algorithm to encode unstructured text information and obtain word vectors and position vectors;
[0019] Using the second BILSTM algorithm, contextual semantic features of unstructured text information are extracted based on word vectors and position vectors to obtain contextual semantic features of the unstructured text information;
[0020] Using the CRF algorithm, named entity recognition is performed on unstructured text information based on contextual semantic features to obtain entity labels for unstructured text information;
[0021] According to the entity labels, entity extraction is performed on the unstructured text information to obtain the target entity information.
[0022] Preferably, the entity tag includes a device tag and a location tag, and the target entity information includes a defective device name, a defective location name, device defect information, and a defect handling strategy. According to the entity tag, entity extraction is performed on the unstructured text information to obtain the target entity information, including:
[0023] According to the equipment label, the defective equipment name corresponding to the equipment label is extracted from the unstructured text information;
[0024] According to the location label corresponding to the defective device name, the defect location name corresponding to the location label is extracted from the unstructured text information;
[0025] According to the defect location name, extract the equipment defect information corresponding to the defect location name in the unstructured text information, the equipment defect information includes the equipment defect level, equipment defect cause, equipment defect phenomenon and equipment defect type;
[0026] According to the equipment defect phenomenon, the defect handling strategy corresponding to the equipment defect phenomenon is extracted from the unstructured text information.
[0027] As a preferred method, a knowledge graph of power equipment defects is constructed based on target structured text information and target entity information, including:
[0028] By using the knowledge fusion strategy based on similarity propagation, the target structured text information and target entity information are fused to obtain the target text entity information.
[0029] Based on the knowledge storage strategy of Neo4j database, the target text entity information is stored to construct the knowledge graph of power equipment defects.
[0030] Preferably, the knowledge fusion strategy based on similarity propagation includes a similarity algorithm, which is used to semantically match entities in the target structured text information and the target entity information. The similarity algorithm is:
[0031]
[0032] Among them, Y i Represents the vector of the i-th entity, Y s A vector representing the s-th entity.
[0033] In a second aspect, the present invention further provides a device for processing defect information of electric power equipment, comprising:
[0034] An acquisition module is used to acquire power equipment defect information, where the power equipment defect information includes structured text information and unstructured text information;
[0035] The enhancement module is used to enhance the structured text information using the preset improved BILSTM algorithm to obtain the target structured text information;
[0036] The extraction module is used to extract entities from unstructured text information using the preset improved BERT algorithm to obtain target entity information;
[0037] A building module is used to construct a knowledge graph of power equipment defects based on target structured text information and target entity information.
[0038] In a third aspect, the present invention further provides a computer device, comprising a processor and a memory, wherein the memory is used to store a computer program, and when the computer program is executed by the processor, the method for processing defect information of power equipment as in the first aspect is implemented.
[0039] In a fourth aspect, the present invention further provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the method for processing defect information of electric power equipment as in the first aspect.
[0040] Compared with the prior art, the present invention has the following beneficial effects:
[0041] The present invention utilizes a preset improved BILSTM algorithm to perform text enhancement on structured text information to obtain target structured text information to ensure the quality of the defect text, thereby improving the content quality of the subsequently constructed knowledge graph; then utilizes a preset improved BERT algorithm to perform entity extraction on unstructured text information to obtain target entity information, so as to realize information extraction for power equipment defect text with characteristics such as heterogeneity, diversity and fragmentation, and at the same time, the improved BERT algorithm can improve the accuracy of entity extraction; finally, based on the target structured text information and target entity information, a power equipment defect knowledge graph is constructed, so that the power equipment defect information is managed in a knowledge graph manner, which can effectively improve the comprehensiveness and reliability of knowledge management and improve knowledge support for subsequent applications. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] Figure 1 A schematic diagram of a process flow of a method for processing defect information of electric power equipment according to an embodiment of the present invention;
[0043] Figure 2 A schematic diagram of text enhancement based on an improved BI-LSTM algorithm according to an embodiment of the present invention;
[0044] Figure 3 A schematic diagram of entity extraction based on an improved BERT algorithm according to an embodiment of the present invention;
[0045] Figure 4A schematic diagram of the structure of the Bert algorithm shown in an embodiment of the present invention;
[0046] Figure 5 A schematic diagram of the structure of the Bert model input shown in an embodiment of the present invention;
[0047] Figure 6 A schematic diagram of a self-attention mechanism according to an embodiment of the present invention;
[0048] Figure 7 This is a schematic diagram of the structure of the BILSTM algorithm shown in an embodiment of the present invention;
[0049] Figure 8 A schematic diagram showing a comparison of knowledge update results in an embodiment of the present invention;
[0050] Fig. 9 A schematic diagram of the structure of a device for processing defect information of electric power equipment according to an embodiment of the present invention;
[0051] Fig.10 The figure is a schematic diagram of the structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0052] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0053] Please refer to Figure 1 , Figure 1 A flowchart of a method for processing defect information of power equipment provided in an embodiment of the present invention. First, based on the contextual semantic information extraction strategy of BILSTM, the problem of BERT's insufficient acquisition of contextual semantics during entity extraction is solved. Then, based on the label prediction branch improvement strategy of CRF, the problem that BERT only considers local information and is prone to fall into local optimality is solved. Finally, based on the improved BERT algorithm, entity information can be quickly extracted from the defect text of power equipment. The method of the embodiment of the present invention can be applied to computer devices, including but not limited to smart phones, laptops, tablet computers, desktop computers, physical servers, cloud servers and other devices. Figure 1 As shown, the method for processing power equipment defect information in this embodiment includes steps S101 to S104, which are described in detail as follows:
[0054] Step S101: acquiring power equipment defect information, where the power equipment defect information includes structured text information and unstructured text information.
[0055] In this step, structured text information refers to text information with a clear grammatical structure, and unstructured text information refers to text information with an unclear grammatical structure.
[0056] Step S102: using a preset improved BILSTM algorithm, perform text enhancement on the structured text information to obtain target structured text information.
[0057] In the steps, the BILSTM algorithm is a bidirectional long short-term memory algorithm, and the improved BILSTM algorithm includes the UCNN algorithm and the first BILSTM algorithm. The UCNN algorithm is a U-shaped convolutional neural network algorithm. Among them, the word semantic feature extraction strategy based on UCNN can solve the problem that BILSTM pays more attention to the meaning of sentences and ignores the characteristics of text words; in the training stage of the improved BILSTM algorithm, the reconstruction strategy based on the LeakyRelu activation function is used to solve the problem of gradient disappearance in BILSTM, and the reconstruction strategy based on the Foscal Loss loss function is used to solve the problem of imbalanced defective text data.
[0058] Optionally, before text enhancement, data preprocessing is performed on the structured text information. Specifically, text segmentation is performed based on the Jieba word segmentation, and a custom dictionary is introduced as an auxiliary dictionary for word segmentation; then stop words are removed, and the coreference normalization of the text data is performed based on a synonym dictionary to complete the data preprocessing.
[0059] In one embodiment, the improved BILSTM algorithm includes a UCNN algorithm and a first BILSTM algorithm, and step S102 includes:
[0060] Preprocessing the structured text information to obtain preprocessed structured text information, wherein the preprocessing includes text segmentation, stop word removal, and synonym replacement;
[0061] Using the UCNN algorithm, extracting word features from the preprocessed structured text information to obtain word features of the preprocessed structured text information;
[0062] The first BILSTM algorithm is used to perform text classification on the preprocessed structured text information according to the word features to obtain the target structured text information.
[0063] In this embodiment, after the power defect text is segmented, stop words are removed, and coreference is normalized, the text is enhanced based on the improved BILSTM algorithm. Figure 2As shown, first, based on UCNN, feature extraction is performed on the text words after word segmentation, and then it is input into BILSTM for sentence semantic understanding, and then text classification is carried out. Among them, the UCNN algorithm performs convolution calculation and sliding on the original word vector data through a convolution kernel to achieve the extraction of text word features. Different from the traditional CNN, at different positions of the original data, the UCNN uses convolution kernels with different weight sizes. Therefore, the expression of the UCNN algorithm is:
[0064]
[0065] Among them, o(u, v) is the word feature, is the non-shared convolution kernel, w i,j is the weight value at (i, j) in, K r×s represents the word vector set corresponding to the preprocessed structured text information, k u-i,v-j is the word vector in K r×s .
[0066] According to the UCNN framework, it can be seen that the above convolution kernel weight matrix may change when the sliding position (u, v) changes relative to the original word vector data . While the traditional CNN will maintain the same weight matrix at different positions. Obviously, the UCNN of the present invention is more conducive to the extraction of differential words. On this basis, the size r'×s' of the feature map of the defective text is calculated through UCNN, and its calculation formula is:
[0067]
[0068]
[0069] In the formula, t is the UCNN sliding stride, and p is the number of automatic padding layers.
[0070] Finally, the feature matrix K r′×s′ representing the meaning of the defective text words can be obtained, and it is further input into BILSTM for subsequent processing.
[0071] In the training stage of improving the BILSTM algorithm of the present invention, on the basis of the Relu function, LeakyRelu is introduced as the activation function of the UCNN-BILSTM algorithm, and its expression is:
[0072] y = max(ax, x);
[0073] In the formula, x is the activation function input, y is the activation function output, and a(0 < a < 1) is the reverse gradient of the function.
[0074] The present invention introduces the Foscal Loss loss function to solve the impact of unbalanced data, thereby ensuring the accuracy of the model. The Foscal Loss calculation formula is:
[0075]
[0076] Where, L FL (y,y′) is the Foscal Loss loss function. α is the balance factor, which is used to balance the imbalance in the number of samples of different categories. γ is the modulation coefficient, which is used to increase the sensitivity of the loss function to more difficult-to-classify categories. The FoscalLoss loss function can solve the imbalance problem of the power equipment defect text dataset and ensure the accuracy of the model, thereby significantly improving the quality of the structured defect text and ensuring the reliability of the knowledge graph data.
[0077] For example, the improved BILSTM algorithm is trained in the Windows operating system, and the hardware configuration includes: CPU model is i9 9980xe 3GHz, GPU model is GTX2080, and the experimental environment is Python3.8+Pytorch1.10.2+cuda11.3. The data set contains a total of 5679 defect texts, including 2699 external impacts, 1461 equipment aging, 784 construction quality, 527 operation and maintenance quality, 181 product quality, and 26 acceptance quality; 3292 emergency defects and 2387 major defects. The training set, validation set, and test set are divided into 6:2:2.
[0078] The hyperparameter settings for text classification model training are as follows: Embedding Size is 300, UCNN Layer is 1, UCNNCell is 300, BILSTM Layer is 2, BILSTM Cell is 512, the number of fully connected layers is 2, the number of fully connected hidden units is 256, Dropout is 0.2, the learning rate is OneCycleLR adaptive learning rate (initial learning rate 1e-4), and Ecoph is 240.
[0079] In order to reflect the overall performance of the improved BILSTM algorithm, we trained the traditional mainstream text classification models TextCNN, SVM, and BILSTM on the same dataset and compared the overall performance of the various algorithms. The specific results are shown in the following table.
[0080]
[0081] As shown in the table above, in the text defect classification, the performance of the improved BILSTM algorithm is significantly better than that of TextCNN, SVM and BILSTM algorithms, and its prediction accuracy is higher than 75%, which is significantly better than the prediction accuracy of other algorithms below 70%. It can be seen that compared with the traditional mainstream text classification algorithm, the improved BILSTM algorithm has better performance in classifying power equipment defect text.
[0082] Step S103: Use the preset improved BERT algorithm to perform entity extraction on the unstructured text information to obtain target entity information.
[0083] In this step, the BERT algorithm is a Bidirectional Encoder RepresentationsfromTransformers language model algorithm, and the improved BERT algorithm includes the BERT algorithm, the second BILSTM algorithm, and the CRF algorithm, and the CRF algorithm is a conditional random field algorithm.
[0084] In one embodiment, the step S1013 includes:
[0085] Using the BERT algorithm, the unstructured text information is encoded to obtain a word vector and a position vector;
[0086] Using the second BILSTM algorithm, extracting contextual semantic features of the unstructured text information according to the word vector and the position vector, to obtain contextual semantic features of the unstructured text information;
[0087] Using the CRF algorithm, according to the contextual semantic features, the unstructured text information is subjected to named entity recognition to obtain entity tags of the unstructured text information;
[0088] According to the entity label, entity extraction is performed on the unstructured text information to obtain the target entity information.
[0089] In this embodiment, the entity extraction process of the improved BERT algorithm is as follows: Figure 3As shown in the figure, firstly, the Transformer structure in the BERT pre-trained language model is used to encode a single character in the defective text of the input layer, and the word vector and position vector corresponding to the single character are obtained by training, which are used as the initialization input of the BILSTM layer; then the BILSTM layer is used to bidirectionally encode the vector information of the input defective text, and further calculate the semantic information related to the text context; finally, the semantic vector containing the context information is input into the CRF layer, and the Viterbi algorithm is used for decoding. The CRF model calculates the global optimal result and outputs the label sequence with the highest probability, thereby obtaining the entity category of each character in the defective text.
[0090] For the BERT algorithm: BERT is a deep bidirectional language representation model with the following structure: Figure 4 As shown. Figure 4 It can be seen that the first layer of the BERT model is the input layer, E i Represents the input word, TrmE in the second and third layers represents the Transformer encoding structure, and T in the fourth layer i represents the output result, and N represents the total number of input words.
[0091] For example, Figure 5 As shown in the figure, the input layer of the BERT model consists of three parts: word vector, sentence vector and position vector. [CLS] is the start mark of the text, and [SEP] is the sentence separator or the end mark of the text. Token converts each word in the defective text into a one-dimensional vector by querying the word vector table, which represents the original word vector of the word. Segment is used to distinguish different defective texts, indicating the sentence vector position of the current word in the defective text. Position is used to represent the sequence position of the current word in the defective text. Secondly, there are 12 layers of TrmE networks in the second and third layers of the BERT model, and each layer of TrmE network consists of 6 layers of encoders. Among them, the TrmE network mainly uses the self-attention mechanism, which is used to calculate the relationship weight between each word and its context, and give the weight to each word in the context, and update the word vector of the word according to the weight, so as to obtain a new word vector. The new word vector contains the semantic information of the word itself and its context.
[0092] For example, the generation process of the self-attention mechanism is as follows Figure 6 As shown. Figure 6 In the example, the input is the query vector, key vector, and value vector, which are represented as Q, K, and V respectively. The calculation formulas are:
[0093] Q=XW Q , K = XW K , V = XW V ;
[0094] Where X is the input matrix, W Q , W K , W V is the weight matrix. The calculation formula of the relation weight output by the self-attention mechanism is:
[0095]
[0096] In the formula, is a penalty factor used to ensure that the product of Q and K is not too large.
[0097] The Bert model uses a multi-head attention mechanism based on the self-attention mechanism. The number of heads is also the number of self-attention mechanisms. In the multi-head attention mechanism, each self-attention mechanism focuses on different context information of the same word, and its output matrix head i It can be expressed as:
[0098] head i =Attention(QW i Q , KW i K , VW i V );
[0099] The calculation formula of the output matrix MultiHead of the multi-head attention mechanism is:
[0100] MulitiHead(Q,K,V)=Concat(head 1 , head 2 …head k )W O ;
[0101] In the formula, Concat is to combine each head i After connecting with the connection matrix W O The result of multiplication.
[0102] Finally, the BERT model outputs the result based on the word vector of the fourth layer. When the model represents the word vector, it can obtain a character vector rich in the semantic information of the defective text and preserve the semantic information of the text more completely.
[0103] For the second BILSTM algorithm: The BILSTM algorithm is used to further extract contextual semantic information from the character vector of the defective text to obtain more comprehensive contextual semantic features, thereby ensuring the robustness of semantic learning of the named entity extraction model. The traditional LSTM algorithm has only one layer of network to encode the sentence from front to back, and only grasps the contextual information from front to back of the sentence, but not the contextual information from back to front. Figure 7 As shown, the second BILSTM algorithm of the present invention is composed of a forward LSTM algorithm and a backward LSTM algorithm, which can realize bidirectional learning of context information. The output of the final BILSTM layer is expressed as:
[0104] h(t)=[o pre ,o pos ];
[0105] Where h is the concatenation of the forward and backward outputs of the BILSTM algorithm, t is the time step, and o is pre ,o pos They are the outputs of forward LSTM and backward LSTM respectively.
[0106] For the CRF algorithm: In order to obtain global information from the defect text and apply it to the model output, the present invention replaces the softmax layer with the CRF layer. CRF is a discriminant probability model that can mark and segment ordered sequences. For the sequence X = (x 1 ,x 2 ,…,x n ), state sequence Y=(y 1 ,y 2 ,…y n The calculation formula of the conditional probability P(y|x) of ) is:
[0107]
[0108]
[0109] In the formula, f k is the characteristic function, w k Yes k The weight of , Z(x) is the normalization function.
[0110] The CRF model is trained by maximizing the log-likelihood function. The conditional probability calculation formula for the label sequence y of a given power equipment defect text A is:
[0111]
[0112] Loss = log(P(y|A));
[0113] In the formula, is the true label, yA is all possible label combinations of the given defect text A, and Loss is the defined loss function.
[0114] When using CRF to make the final prediction of the entity label of the power equipment defect text, the viterbi algorithm is used to obtain the global optimal solution, and the solution formula is:
[0115]
[0116] In the formula, y * The text label sequence of power equipment defects with the maximum score.
[0117] It can be seen that using CRF to predict label output in BERT's sequence labeling task can effectively constrain the dependency between predicted labels, thereby obtaining the global optimal sequence.
[0118] For entity extraction, in one embodiment, the entity tag includes a device tag and a location tag, the target entity information includes a defective device name, a defective location name, device defect information, and a defect handling strategy, and the entity extraction is performed on the unstructured text information according to the entity tag to obtain the target entity information, including:
[0119] According to the device label, extracting the defective device name corresponding to the device label from the unstructured text information;
[0120] According to the location tag corresponding to the defective device name, extracting the defect location name corresponding to the location tag from the unstructured text information;
[0121] According to the defect location name, extracting equipment defect information corresponding to the defect location name from the unstructured text information, the equipment defect information including equipment defect level, equipment defect cause, equipment defect phenomenon and equipment defect type;
[0122] According to the equipment defect phenomenon, a defect handling strategy corresponding to the equipment defect phenomenon is extracted from the unstructured text information.
[0123] In this embodiment, when extracting entity relationships from the power equipment defect text, the entity type is directly determined by the entity tag, and then entity relationship extraction rules are established based on the defined entity relationships. The extraction rules are as follows:
[0124] First, centering on the defective device name, the name of the defective device is extracted according to the entity tag equipment of the defective device name;
[0125] Secondly, according to the entity tag position, the name of the defect part related to it is extracted;
[0126] Then, taking the extracted defect part name as the entity center, the relevant equipment defect level, equipment defect cause, equipment defect phenomenon, and equipment defect type are extracted according to various entity labels.
[0127] Finally, taking the equipment defect phenomenon as the entity center, defect handling measures are extracted.
[0128] Exemplarily, entity extraction is performed in the Windows operating system, the development language is Python, the version is Python3.8, the deep learning framework Tensorflow version is 1.12.0, the Bert model is Bert-Base-Chinese version, and the hardware configuration is: CPU model is i9 9980xe 3GHz, and GPU model is GTX2080.
[0129] The BERT-BILSTM-CRF named entity extraction algorithm is compared with mainstream algorithms such as HMM, CRF, BILSTM, BILSTM-CRF and BERT, and then the entity extraction results of BERT-BILSTM-CRF are analyzed. The test results are shown in the following table.
[0130]
[0131]
[0132] As can be seen from the above table, when HMM, CRF, BILSTM, BILSTM-CRF, BERT and the BERT-BILSTM-CRF algorithm of the present invention are used to extract entities from power equipment defect text, the improved BERT algorithm of the present invention achieves the best extraction effect on seven types of entities: defect phenomenon, defect equipment, defect level, treatment measures, defect location, defect cause and defect type. The improved BERT algorithm has a certain degree of improvement in accuracy, recall and F1 value, which can effectively improve the named entity extraction results, is conducive to the subsequent entity relationship extraction, and can provide reliable data for building knowledge graphs.
[0133] Step S104: constructing a knowledge graph of power equipment defects based on the target structured text information and target entity information.
[0134] In this step, a collective entity fusion strategy based on similarity propagation is proposed based on the Neo4j database to solve the problem that the defect text data has a wide range of sources and is difficult to merge; a knowledge storage strategy is proposed based on the Neo4j database to solve the problem that the defect text volume is large and difficult to store and query; a knowledge update strategy is proposed based on the Neo4j database to solve the problem of slow update speed of real-time defect data. The power equipment defect knowledge graph constructed by the present invention has comprehensive and reliable knowledge, which can provide knowledge support for its subsequent application.
[0135] Neo4j database is a high-performance NOSQL (Not Only SQL) graph database. It is an embedded, disk-based, fully transactional Java persistence engine. Its structured data is stored on the network.
[0136] In one embodiment, the step S104 includes:
[0137] Using a knowledge fusion strategy based on similarity propagation, the target structured text information and the target entity information are fused to obtain the target text entity information;
[0138] Based on the knowledge storage strategy of Neo4j database, the target text entity information is stored in order to construct the power equipment defect knowledge graph.
[0139] In this embodiment, for knowledge fusion: a collective entity knowledge fusion strategy based on similarity propagation is used for knowledge fusion. In one embodiment, the knowledge fusion strategy based on similarity propagation includes a pre-cosine similarity algorithm, which is used to semantically match entities in the target structured text information and the target entity information, and the cosine similarity algorithm is:
[0140]
[0141] Among them, Y i Represents the vector of the i-th entity, Y s A vector representing the s-th entity.
[0142] According to the similarity propagation algorithm, semantic matching is performed on entity pairs. Assuming that two connected entities with similar names have high similarity, the similarity between entities can be continuously propagated until the entity traversal is completed or the set threshold is reached. The specific strategy is shown in the following table.
[0143]
[0144] For knowledge storage: use the knowledge storage strategy based on Cypher statements to store knowledge.
[0145] Construct triples based on the structured defect text after text enhancement (i.e. the above-mentioned target structured text information) and the unstructured defect text after information extraction (i.e. the above-mentioned target entity information), and then batch import the CSV file. Use the LOAD CSV command to batch import the CSV files with constructed triples. Before importing the data, first put the CSV file in the import directory under the Neo4j folder to facilitate the next step of batch uploading data. When importing the CSV file, first start the Neo4j database in the background and import the data into the database. After importing the above-mentioned power equipment defect text data, the structured and unstructured defect texts are completely stored in the power equipment defect knowledge graph, the defect data import speed is fast, and the knowledge graph storage is completed.
[0146] For knowledge updating: adopt knowledge updating strategy to achieve knowledge updating.
[0147] When generating new defect text, the new defect text is first fused with the original knowledge through a collective entity fusion strategy based on similarity propagation. Then the fused defect text is judged. If there is a new entity class in the defect text data, a new entity class is created in the knowledge graph. Otherwise, the data after knowledge fusion is added to the knowledge graph to complete the knowledge update.
[0148] For example, the knowledge update effect is as follows: Figure 8 shown. Figure 8 Before the knowledge update, the defective parts of the distribution transformer included six types: medium-voltage bushing, grounding down conductor, oil tank / oil pillow, grounding knife switch, overhead wire and metering terminal. After the knowledge update, the defective parts of the distribution transformer were increased to three new types: voltage regulating switch, busbar, cover plate and low-voltage bushing on the basis of the original ones.
[0149] It should be noted that the method for processing power equipment defect information of the present invention can solve the problem of difficult information display and mapping caused by the large size of power equipment, multi-source heterogeneity, and redundant and messy information, and construct a complete power equipment defect knowledge network to provide accurate and professional solutions for the defect elimination process of power equipment, and has good application prospects.
[0150] The method for processing power equipment defect information corresponding to the above method embodiment is implemented to achieve corresponding functions and technical effects. Fig. 9 , Fig. 9 The structural block diagram of a device for processing defect information of electric power equipment provided by an embodiment of the present invention is shown. For the convenience of explanation, only the parts related to this embodiment are shown. The device for processing defect information of electric power equipment provided by an embodiment of the present invention includes:
[0151] An acquisition module 901 is used to acquire power equipment defect information, where the power equipment defect information includes structured text information and unstructured text information;
[0152] An enhancement module 902 is used to perform text enhancement on the structured text information using a preset improved BILSTM algorithm to obtain target structured text information;
[0153] The extraction module 903 is used to perform entity extraction on the unstructured text information using a preset improved BERT algorithm to obtain target entity information;
[0154] The construction module 904 is used to construct a knowledge graph of power equipment defects based on the target structured text information and target entity information.
[0155] In one embodiment, the improved BILSTM algorithm includes a UCNN algorithm and a first BILSTM algorithm, and the enhancement module 902 is specifically used for:
[0156] Preprocessing the structured text information to obtain preprocessed structured text information, wherein the preprocessing includes text segmentation, stop word removal, and synonym replacement;
[0157] Using the UCNN algorithm, extracting word features from the preprocessed structured text information to obtain word features of the preprocessed structured text information;
[0158] The first BILSTM algorithm is used to perform text classification on the preprocessed structured text information according to the word features to obtain the target structured text information.
[0159] In one embodiment, the expression of the UCNN algorithm is:
[0160]
[0161] Among them, o(u,v) is the word feature, is a non-shared convolution kernel, w i,j for The weight value at (i, j) in K r×s represents the word vector set corresponding to the structured text information after preprocessing, k u-i,v-j K r×s The word vectors in .
[0162] In one embodiment, the improved BERT algorithm includes a BERT algorithm, a second BILSTM algorithm and a CRF algorithm, and the extraction module 903 includes:
[0163] An encoding unit, used to encode the unstructured text information using the BERT algorithm to obtain a word vector and a position vector;
[0164] An extraction unit, configured to extract contextual semantic features of the unstructured text information according to the word vector and the position vector by using the second BILSTM algorithm, so as to obtain contextual semantic features of the unstructured text information;
[0165] A recognition unit, configured to perform named entity recognition on the unstructured text information according to the contextual semantic features by using the CRF algorithm to obtain an entity label of the unstructured text information;
[0166] An extraction unit is used to perform entity extraction on the unstructured text information according to the entity label to obtain the target entity information.
[0167] In one embodiment, the entity tag includes a device tag and a location tag, the target entity information includes a defective device name, a defect location name, device defect information, and a defect handling strategy, and the extraction unit is specifically used to:
[0168] According to the device label, extracting the defective device name corresponding to the device label from the unstructured text information;
[0169] According to the location tag corresponding to the defective device name, extracting the defect location name corresponding to the location tag from the unstructured text information;
[0170] According to the defect location name, extracting equipment defect information corresponding to the defect location name from the unstructured text information, the equipment defect information including equipment defect level, equipment defect cause, equipment defect phenomenon and equipment defect type;
[0171] According to the equipment defect phenomenon, a defect handling strategy corresponding to the equipment defect phenomenon is extracted from the unstructured text information.
[0172] In one embodiment, the construction module 904 is specifically used to:
[0173] Using a knowledge fusion strategy based on similarity propagation, the target structured text information and the target entity information are fused to obtain the target text entity information;
[0174] Based on the knowledge storage strategy of Neo4j database, the target text entity information is stored in order to construct the power equipment defect knowledge graph.
[0175] In one embodiment, the knowledge fusion strategy based on similarity propagation includes a similarity algorithm, and the similarity algorithm is used to perform semantic matching between the target structured text information and entities in the target entity information, and the similarity algorithm is:
[0176]
[0177] Among them, Y i Represents the vector of the i-th entity, Y s A vector representing the s-th entity.
[0178] The above-mentioned processing device for power equipment defect information can implement the processing method for power equipment defect information of the above-mentioned method embodiment. The options in the above-mentioned method embodiment are also applicable to this embodiment and will not be described in detail here. The rest of the contents of the embodiment of the present invention can refer to the contents of the above-mentioned method embodiment, and will not be repeated in this embodiment.
[0179] Fig.10 A schematic diagram of the structure of a computer device provided in one embodiment of the present invention. Fig.10 As shown, the computer device 100 of this embodiment includes: at least one processor 1000 ( Fig.10 Only one is shown in the figure) a processor, a memory 1001, and a computer program 1002 stored in the memory 1001 and executable on the at least one processor 1000, and when the processor 1000 executes the computer program 1002, the steps in any of the above method embodiments are implemented.
[0180] The computer device 100 may be a computing device such as a smart phone, a tablet computer, a desktop computer, a cloud server, etc. The computer device may include but is not limited to a processor 1000 and a memory 1001. Those skilled in the art will appreciate that Fig.10 The computer device 100 is merely an example and does not constitute a limitation on the computer device 100 . The computer device 100 may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the computer device 100 may also include input and output devices, network access devices, etc.
[0181] The processor 1000 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.
[0182] In some embodiments, the memory 1001 may be an internal storage unit of the computer device 100, such as a hard disk or memory of the computer device 100. In other embodiments, the memory 1001 may also be an external storage device of the computer device 100, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the computer device 100. Further, the memory 1001 may also include both an internal storage unit of the computer device 100 and an external storage device. The memory 1001 is used to store an operating system, an application program, a boot loader (BootLoader), data and other programs, such as the program code of the computer program, etc. The memory 1001 may also be used to temporarily store data that has been output or is to be output.
[0183] In addition, an embodiment of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in any of the above method embodiments are implemented.
[0184] An embodiment of the present invention provides a computer program product. When the computer program product is run on a computer device, the computer device implements the steps in the above-mentioned method embodiments when executing the computer device.
[0185] In several embodiments provided by the present invention, it is understood that each box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, a program segment or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from that marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved.
[0186] If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device to perform all or part of the steps of the methods described in various embodiments of the present invention. The aforementioned storage media include: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, and other media that can store program codes.
[0187] The specific embodiments described above further illustrate the purpose, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the protection scope of the present invention. It is particularly pointed out that for those skilled in the art, any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A method for processing defect information of electric power equipment, characterized in that: include: Acquiring power equipment defect information, wherein the power equipment defect information includes structured text information and unstructured text information; Using a preset improved BILSTM algorithm, text enhancement is performed on the structured text information to obtain target structured text information; the improved BILSTM algorithm includes a UCNN algorithm and a first BILSTM algorithm, and using a preset improved BILSTM algorithm to perform text enhancement on the structured text information to obtain target structured text information includes: preprocessing the structured text information to obtain preprocessed structured text information, wherein the preprocessing includes text segmentation, stop word removal and synonym replacement; using the UCNN algorithm, word feature extraction is performed on the preprocessed structured text information to obtain word features of the preprocessed structured text information; using the first BILSTM algorithm, according to the word features, text classification is performed on the preprocessed structured text information to obtain the target structured text information; wherein the expression of the UCNN algorithm is: Among them, o(u,v) is the word feature, is a non-shared convolution kernel, w i,j for The weight value at (i, j) in K r×s represents the word vector set corresponding to the structured text information after preprocessing, k u-i,v-j K r×s The word vectors in ; Using a preset improved BERT algorithm, entity extraction is performed on the unstructured text information to obtain target entity information; the improved BERT algorithm includes a BERT algorithm, a second BILSTM algorithm and a CRF algorithm. Using a preset improved BERT algorithm, entity extraction is performed on the unstructured text information to obtain target entity information, including: using the BERT algorithm to encode the unstructured text information to obtain a word vector and a position vector; using the second BILSTM algorithm to extract contextual semantic features of the unstructured text information according to the word vector and the position vector to obtain contextual semantic features of the unstructured text information; using the CRF algorithm to perform named entity recognition on the unstructured text information according to the contextual semantic features to obtain entity labels of the unstructured text information; according to the entity labels, entity extraction is performed on the unstructured text information to obtain the target entity information; Based on the target structured text information and target entity information, a knowledge graph of power equipment defects is constructed, including: using a knowledge fusion strategy based on similarity propagation to perform knowledge fusion on the target structured text information and the target entity information to obtain target text entity information; based on a knowledge storage strategy of the Neo4j database, the target text entity information is stored to construct the knowledge graph of power equipment defects.
2. The method for processing power equipment defect information according to claim 1, characterized in that: The entity tag includes a device tag and a location tag, the target entity information includes a defective device name, a defect location name, device defect information, and a defect handling strategy, and the entity extraction is performed on the unstructured text information according to the entity tag to obtain the target entity information, including: According to the device label, extracting the defective device name corresponding to the device label from the unstructured text information; According to the location tag corresponding to the defective device name, extracting the defect location name corresponding to the location tag from the unstructured text information; According to the defect location name, extracting equipment defect information corresponding to the defect location name from the unstructured text information, the equipment defect information including equipment defect level, equipment defect cause, equipment defect phenomenon and equipment defect type; According to the equipment defect phenomenon, a defect handling strategy corresponding to the equipment defect phenomenon is extracted from the unstructured text information.
3. The method for processing power equipment defect information according to claim 1, characterized in that: The knowledge fusion strategy based on similarity propagation includes a similarity algorithm, which is used to perform semantic matching between the target structured text information and entities in the target entity information. The similarity algorithm is: Among them, Y i Represents the vector of the i-th entity, Y s A vector representing the s-th entity.
4. A device for processing defect information of electric power equipment, characterized in that: include: An acquisition module, used for acquiring power equipment defect information, wherein the power equipment defect information includes structured text information and unstructured text information; The enhancement module is used to use a preset improved BILSTM algorithm to perform text enhancement on the structured text information to obtain target structured text information; the improved BILSTM algorithm includes a UCNN algorithm and a first BILSTM algorithm, and the method of using a preset improved BILSTM algorithm to perform text enhancement on the structured text information to obtain target structured text information includes: preprocessing the structured text information to obtain preprocessed structured text information, wherein the preprocessing includes text segmentation, stop word removal and synonym replacement; using the UCNN algorithm to extract word features from the preprocessed structured text information to obtain word features of the preprocessed structured text information; using the first BILSTM algorithm, according to the word features, text classification is performed on the preprocessed structured text information to obtain the target structured text information; wherein the expression of the UCNN algorithm is: Among them, o(u,v) is the word feature, is a non-shared convolution kernel, w i,j for The weight value at (i, j) in K r×s represents the word vector set corresponding to the structured text information after preprocessing, k u-i,v-j K r×s The word vectors in ; An extraction module is used to use a preset improved BERT algorithm to perform entity extraction on the unstructured text information to obtain target entity information; the improved BERT algorithm includes a BERT algorithm, a second BILSTM algorithm and a CRF algorithm. The method of using the preset improved BERT algorithm to perform entity extraction on the unstructured text information to obtain target entity information includes: using the BERT algorithm to encode the unstructured text information to obtain a word vector and a position vector; using the second BILSTM algorithm to perform contextual semantic feature extraction on the unstructured text information according to the word vector and the position vector to obtain the contextual semantic feature of the unstructured text information; using the CRF algorithm to perform named entity recognition on the unstructured text information according to the contextual semantic feature to obtain the entity label of the unstructured text information; according to the entity label, performing entity extraction on the unstructured text information to obtain the target entity information; A construction module is used to construct a knowledge graph of power equipment defects based on the target structured text information and the target entity information, including: using a knowledge fusion strategy based on similarity propagation to perform knowledge fusion on the target structured text information and the target entity information to obtain target text entity information; based on a knowledge storage strategy of the Neo4j database, the target text entity information is stored to construct the knowledge graph of power equipment defects.
5. A computer device, characterized in that: It comprises a processor and a memory, wherein the memory is used to store a computer program, and when the computer program is executed by the processor, the method for processing defect information of electric power equipment according to any one of claims 1 to 3 is implemented.
6. A computer-readable storage medium, characterized in that: It stores a computer program, which, when executed by a processor, implements the method for processing power equipment defect information as described in any one of claims 1 to 3.
Citation Information
Patent Citations
Electric power communication network knowledge graph construction method based on BERT model
CN112613314A
Power equipment fault defect text named entity extraction method and device
CN113343701A