Power transformation defect key information extraction method and device, electronic equipment and storage medium
By performing feature encoding and deep semantic analysis on substation defect data, and using a "semi-pointer-semi-label" structure and a multi-layer neural network model, the problem of determining the relationship between the main entity and multiple guest entities in the extraction of key information of substation defects was solved, and the accurate and comprehensive extraction of key information was achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- YUNNAN POWER GRID CO LTD KUNMING POWER SUPPLY BUREAU
- Filing Date
- 2022-10-10
- Publication Date
- 2026-06-09
AI Technical Summary
Existing technologies are ineffective at extracting key information about substation defects from lengthy texts, making it difficult to determine the multiple relationships between a main entity and multiple guest entities, resulting in incomplete or missing key information.
A "semi-pointer-semi-label" structure is adopted to encode the features of substation defect data. Character, word-level and position feature encoding are combined, and a target extraction model is used to extract key semantic features, including the prediction of the first and last positions of the main entity and the object entity. Deep semantic analysis and feature fusion are performed through a multi-layer neural network model.
It achieves full extraction of key semantic features from substation defect data, avoids the loss of key information, improves the accuracy and completeness of extraction, and can effectively handle situations involving multiple main entities and guest entities.
Smart Images

Figure CN115563264B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of communication technology, and in particular to a method, apparatus, electronic device and storage medium for extracting key information on substation defects. Background Technology
[0002] During the operation and management of power grid equipment, information such as equipment fault data, defects, maintenance, and solutions is stored in documents. When a substation defect occurs, it is extremely difficult to rely on manual methods to retrieve past expert experience from existing documents to find solutions. The utilization rate of past knowledge documents on substation defects is very low. Therefore, the automatic extraction of key information about substation defects is crucial.
[0003] The primary technology for extracting key information about substation defects is named entity recognition (REntity Recognition). The purpose of REntity Recognition is to identify nouns in text that have specific meaning or strong referentiality, such as names of people, places, and organizations. In the process of extracting key information about substation defects, it is also necessary to extract specialized terms specific to the power industry. Specifically, REntity Recognition requires accurately defining the text boundaries of named entities and correctly classifying them.
[0004] Traditional methods for extracting critical information about substation defects are primarily rule-based. These methods require constructing rule templates and incorporating personal experience to formulate rules, followed by named entity recognition through pattern and string matching. Features used include statistical information, punctuation marks, keywords, indicator words, directional words, location words, and central words. However, traditional rule-based critical information extraction methods suffer from drawbacks such as over-reliance on dictionary and knowledge base construction, poor system portability, and long system development cycles. Furthermore, they require manual rule setting for different systems and cannot be adapted to multiple domains simultaneously. While effective with small datasets, the established rules become insufficient for large-scale data processing as the data volume increases, making it difficult to guarantee consistent results.
[0005] Besides traditional methods for extracting key information about substation defects, existing technologies also include multi-granularity key information extraction methods for legal documents. For example, in the research on "Entity Relationship Extraction Algorithm for Legal Documents," case information can be divided into coarse-grained and fine-grained information according to the extraction granularity. The two types of information are then extracted separately by constructing a grammatical rule set and training a deep learning-based triplet extraction model. This method achieves joint entity relationship extraction, using BiLSTM and the pre-trained BERT model for encoding representation, and incorporating a legal domain knowledge dictionary as reinforcement features through an attention mechanism into the model, followed by LSTML for decoding. This method can process unstructured legal document text recorded in natural language into structured triplets.<e1,r,e2> The set format helps in the structured representation of documents and the construction of case knowledge graphs.
[0006] Existing methods for extracting key information from legal documents at a multi-granularity level, based on deep learning, can meet the requirements of large-scale data. However, when extracting key information about substation defects, only one triplet is extracted from a sentence, but in reality, a sentence may contain multiple pairs of triples. Therefore, the effect of extracting triples from large texts is poor, making it difficult to determine the multiple relationships between a main entity and multiple object entities. This results in missing or incomplete key information being extracted. Summary of the Invention
[0007] This application provides a method, apparatus, electronic device, and storage medium for extracting key information on substation defects, in order to solve the problems of poor performance in extracting triples from large amounts of text, difficulty in determining multiple relationships between a main entity and multiple guest entities, resulting in missing or incomplete key information in the final extraction.
[0008] Firstly, this application provides a method for extracting key information about substation defects, the method comprising:
[0009] The substation defect data is labeled to obtain the target substation defect data;
[0010] The target substation defect data is input into the target extraction model, and the target substation defect data is extracted using a "semi-pointer-semi-label" structure to obtain the target key semantic features. The target key semantic features include the key semantic features in the target substation defect data and the key semantic features missing in the target substation defect data.
[0011] The key semantic features of the target are semantically analyzed to obtain key information on substation defects; the key information on substation defects includes the causes of substation defects and the solutions to substation defects.
[0012] Optionally, before annotating the substation defect data to obtain the target substation defect data, the method further includes:
[0013] Obtain raw substation defect data;
[0014] Use a dedicated substation defect stop word list to remove stop words from the original substation defect data;
[0015] The substation defect data is obtained by adjusting the errors in the original substation defect data using a target tool.
[0016] Optionally, the step of annotating the substation defect data to obtain target substation defect data includes:
[0017] The first and second substation defect sequence data in the substation defect data are labeled to obtain the target substation defect data;
[0018] The first substation defect sequence data represents the cause of the substation defect, and the second substation defect sequence data represents the solution to the substation defect; there is a corresponding relationship between the first substation defect sequence data and the second substation defect sequence data.
[0019] Optionally, the step of annotating the substation defect data to obtain the target substation defect data further includes:
[0020] Based on specialized terminology and grammar in the field of substation defects, the first substation defect sequence data and the second substation defect sequence data in the substation defect data were reviewed and adjusted.
[0021] Optionally, the target key semantic features are the subject entity and object entity mapped based on the target relationship; the target relationship is the relationship involved in the historical substation defect data;
[0022] The target substation defect data is input into the target extraction model, and a "semi-pointer-semi-label" structure is used to extract the target substation defect data to obtain the target key semantic features, including:
[0023] The input target substation defect data is feature-encoded to obtain character feature codes, word-level feature codes, and location feature codes;
[0024] Based on the character feature encoding, word-level feature encoding, and position feature encoding, using a "half-pointer-half-label" structure, the first and last positions of the main entity are predicted first, and then the first and last positions of the guest entity mapped to the main entity are predicted based on any target relationship.
[0025] Based on the beginning and end positions of the main entity and the beginning and end positions of the guest entity corresponding to any target relationship, key semantic features of the target are extracted from the target substation defect data to obtain the main entity and guest entity mapped based on any target relationship.
[0026] Optionally, the target extraction model includes a feature encoding layer, a DGCCN layer, a first Faster R-CNN+Dense layer, a second Faster R-CNN+Dense layer, a first multi-self-attention layer, a second multi-self-attention layer, and a BiGRU layer.
[0027] Based on the aforementioned character feature encoding, word-level feature encoding, and positional feature encoding, using a "semi-pointer-semi-label" structure, the first and last positions of the main entity are predicted first, and then the first and last positions of the object entity are predicted based on any target relationship, including:
[0028] The character feature encoding, word-level feature encoding, and positional feature encoding are input into the DGCCN layer for deep semantic analysis to obtain sequence feature encoding.
[0029] The sequence feature encoding is input into the first multi-self-attention layer for feature encoding, and the output of the first multi-self-attention layer is input into the first Faster R-CNN+Dense layer for prediction to obtain the beginning and end positions of the main entity.
[0030] The subsequence corresponding to the main entity in the sequence feature encoding is input into the BiGRU layer to obtain the encoding sequence of the main entity. The encoding sequence of the main entity and the relative position encoding sequence are then fused to obtain the target encoding sequence. The length of the target encoding sequence is the same as the length of the subsequence.
[0031] The sequence feature encoding output of the second multi-self-attention layer, the concatenated feature of the target encoding sequence and prior features are input into the second Faster R-CNN+Dense layer, and prediction is performed for any target relationship to obtain the first and last positions of the guest entity mapped to the main entity based on any target relationship.
[0032] Optionally, the method further includes:
[0033] Acquire historical substation defect data and mark the historical substation defect data;
[0034] Based on the labeled historical substation defect data, the target extraction model is trained and adjusted by training the preset extraction model with the main entities and object entities in the historical substation defect data that are mapped based on the target relationship, so as to obtain the target extraction model.
[0035] Secondly, this application provides a device for extracting key information on substation defects, the device comprising:
[0036] The annotation module is used to annotate substation defect data to obtain target substation defect data;
[0037] The model extraction module is used to input the target substation defect data into the target extraction model, and extract the target substation defect data using a "semi-pointer-semi-label" structure to obtain the target key semantic features. The target key semantic features include the key semantic features in the target substation defect data and the key semantic features missing in the target substation defect data.
[0038] The semantic analysis module is used to perform semantic analysis on the target key semantic features to obtain key information on substation defects; the key information on substation defects includes the causes of substation defects and the solutions to substation defects.
[0039] Thirdly, this application provides an electronic device, including a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus;
[0040] Memory, used to store computer programs;
[0041] When a processor executes a program stored in a memory, it implements the steps of the substation defect key information extraction method according to any embodiment of the first aspect.
[0042] Fourthly, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps of the substation defect key information extraction method as described in any embodiment of the first aspect.
[0043] The technical solutions provided in this application have the following advantages compared with the prior art:
[0044] The substation defect key information extraction method provided in this application introduces the target substation defect data obtained by annotating the substation defect data into the target extraction model. It uses a "semi-pointer-semi-annotation" structure to extract the target key semantic features, which can extract the target key semantic features in the substation defect data more fully and avoid the loss of target key semantic features, which would result in missing substation defect key data in the final extraction. Attached Figure Description
[0045] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.
[0046] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0047] Figure 1 A flowchart illustrating a method for extracting key information about substation defects provided in an embodiment of this application;
[0048] Figure 2 A schematic diagram illustrating a process for extracting key information about substation defects, provided in an embodiment of this application;
[0049] Figure 3 A schematic diagram illustrating the structure of a target extraction model provided in an embodiment of this application;
[0050] Figure 4 A schematic diagram of a device for extracting key information about substation defects provided in an embodiment of this application;
[0051] Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0052] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0053] To address the issues of poor performance in extracting triples from lengthy texts, difficulty in determining multiple relationships between a primary entity and multiple secondary entities, and the resulting in incomplete or missing key information, this application provides a method for extracting key information about substation defects. This method can be applied to any device capable of acquiring substation defect data. For example... Figure 1 As shown, the method for extracting key information about substation defects includes steps 101-103:
[0054] Step 101: Label the substation defect data to obtain the target substation defect data.
[0055] Optionally, before annotating the substation defect data (i.e., performing step 101), the original substation defect data is first obtained, and then the substation defect data is annotated to obtain the target substation defect data. It is understood that the substation defect data annotated subsequently is based on the original substation data.
[0056] The original substation defect data consists of collected text data.
[0057] In one possible implementation, the collected text data contains a large amount of noisy data, requiring data cleaning to improve data quality. Therefore, before labeling substation defects, the raw substation defect data is acquired and preprocessed.
[0058] During data preprocessing, a dedicated substation defect stop word list can be used to remove stop words from the original substation defect data, and the errors in the original substation defect data can be adjusted using target tools to obtain the substation defect data.
[0059] Errors in the raw substation defect data include typos and grammatical errors.
[0060] Specifically, a proprietary substation defect stop word list is constructed to remove stop words (from the original substation defect data); for existing typos and grammatical errors, additional tools are needed for grammatical and typo correction.
[0061] For example, Python can be used in conjunction with a stop word list for stop word filtering, performing matching in dictionary form or using regular expression matching for cleaning. This could include correcting proper nouns, abbreviations, and grammatical errors.
[0062] In this way, after obtaining the original substation defect data, the data is first cleaned and adjusted to eliminate noise data, improve the data quality of the substation defect data, and thus improve the accuracy of extracting key semantic features of the target, thereby improving the accuracy and completeness of the obtained key substation defect information.
[0063] In one possible implementation, the original substation defect data is preprocessed to obtain substation defect data. Then, the first substation defect sequence data and the second substation defect sequence data in the substation defect data are labeled to obtain the target substation defect data. The first substation defect sequence data represents the cause of the substation defect, and the second substation defect sequence data represents the solution to the substation defect. There is a correspondence between the first and second substation defect sequence data.
[0064] For example, the substation defect data includes data related to substation defect 1, namely data 1-3. Data 1 describes the cause of substation defect 1, and data 2 describes the corrective measures taken to address the cause of substation defect 1 in data 1. That is, data 1 is the first substation defect sequence data, labeled "Cause of Substation Defect," and data 2 is the second substation defect sequence data, labeled "Corrective Measures for Substation Defect." Data 1 and data 2 correspond to each other.
[0065] It should be noted that because the collected substation defect data is quite complex, it needs to be labeled before feature encoding. This makes it easier to quickly find the required data from the complex data for feature encoding.
[0066] In addition, when labeling data, the sequence data is mainly labeled in two categories: the main causes of substation defects (i.e., the causes of occurrence mentioned above) and the solutions. In this way, based on the target extraction model, the causes of substation defects and the solutions can be determined more quickly, so as to analyze and take corresponding solutions as soon as possible to resolve the substation defect.
[0067] Specifically, to increase the accuracy of labeling, manual labeling of the data can be combined.
[0068] In one possible implementation, the labeled data is directly used as the target substation defect data.
[0069] In another possible implementation, when annotating the data, specialized terminology or grammar in the field of substation defects can be used to review and adjust the first substation defect sequence data and the second substation defect sequence data in the substation defect data, and the substation defect data after annotation, review and adjustment can be used as the target substation defect data.
[0070] This includes reviewing and adjusting the defect sequence data of the first and second substations, including adjusting the syntax and reviewing and modifying some erroneous data based on experience data.
[0071] In this way, reviewing and adjusting the first and second substation defect sequence data during annotation facilitates the learning and updating of the target extraction model.
[0072] Furthermore, experienced substation defect handling experts in this field can be consulted for manual data review to further ensure the accuracy of data labeling.
[0073] Understandably, some non-technical terms and grammatically incorrect data in substation defects need to be adjusted: replacing electrical technical terms, changing the order of subject, verb, and object, correcting typos, and replacing referential terms (replacing demonstrative pronouns with their original names), etc.
[0074] It should be noted that the review and adjustment of the first and second substation defect sequence data in the substation defect data can be performed after obtaining the substation defect data and before executing step 102.
[0075] By going through the above process, when annotating the data, the data can be reviewed and adjusted based on the knowledge base of this field, which can further improve the data quality and increase the accuracy of the key information finally obtained after extraction.
[0076] In addition, characters can be selected for annotation in this application, which can effectively avoid the problem of boundary segmentation errors.
[0077] Step 102: Input the target substation defect data into the target extraction model, and use a "semi-pointer-semi-label" structure to extract the target substation defect data to obtain the target key semantic features.
[0078] The target key semantic features include both the key semantic features present in the target substation defect data and the key semantic features missing from the target substation defect data. Thus, the target key semantic features extracted from the target substation defect data include not only the actual key semantic features but also the missing key semantic features, achieving the completion of key semantic features and better ensuring the accuracy and completeness of the final substation defect key information.
[0079] Optionally, the key semantic features of the target are the main entity and the object entity mapped based on the target relationship, wherein the target relationship is the relationship involved in the historical substation defect data.
[0080] At this point, after the target substation defect data is input into the target extraction model, the target extraction model first performs feature encoding on the input target substation defect data to obtain character feature encoding, word-level feature encoding, and position feature encoding. Then, based on the character feature encoding, word-level feature encoding, and position feature encoding, using a "semi-pointer-semi-label" structure, the first and last positions of the main entity are predicted. Then, based on any target relationship, the first and last positions of the guest entity mapped to the main entity are predicted. Finally, based on the first and last positions of the main entity and the first and last positions of the guest entity corresponding to any target relationship, the target key semantic features are extracted from the target substation defect data to obtain the main entity and guest entity mapped to any target relationship.
[0081] In one possible implementation, the target extraction model includes a feature encoding layer, a DGCCN layer, a first Faster R-CNN+Dense layer, a second Faster R-CNN+Dense layer, a first multi-self-attention layer, a second multi-self-attention layer, and a BiGRU layer.
[0082] In this process, the target substation defect data is input into the target extraction model. The target extraction model first performs feature encoding on the input target substation defect data through its feature encoding layer, obtaining character feature encoding, word-level (class) feature encoding, and position feature encoding (position embedding) of the input target substation defect data (each sentence). That is, the target substation defect data is represented by these three semantic features.
[0083] Specifically, considering that the effective semantic information stored in a single character is relatively limited, we combine it with word-level features for fusion. This increases the semantic information and ensures the accuracy of key information extraction.
[0084] Character feature encoding can be implemented using one-hot encoding, while word-level feature encoding can be implemented using pre-trained word2vec (a group of related models used to generate word vectors).
[0085] Specifically, in order to align the character feature encoding (or character vector) with the word-level feature encoding (or word vector, word-level vector), the word vector can be repeated n times, where n is the length of the word (i.e. the number of characters in the word).
[0086] Furthermore, to facilitate subsequent model input, the word-level feature encoding can undergo matrix dimensionality transformation to ensure consistency between the character feature encoding and the word-level feature encoding, and the two feature vectors are then concatenated. Thus, after processing the data in step 101, the data is vectorized (feature encoding) into the form required by the model. Specifically, the input data is vectorized into character features (i.e., character feature encoding), word-level semantic features (i.e., word-level feature encoding), and positional features (i.e., positional feature encoding). Then, the feature encoding undergoes dimensionality transformation to ensure consistency and facilitate input into the model.
[0087] Specifically, location information (such as location identifier ID) is encoded through a feature encoding layer to obtain location feature encoding, which is then fused (i.e., concatenated) with character feature encoding and word-level feature encoding to form a complete semantic feature encoding embedding. Since location information also contains some valuable information, fusing location feature encoding, character feature encoding, and word-level feature encoding together and using a target extraction model to extract key semantic features can yield more comprehensive key semantic features, avoiding incomplete key information in the final result.
[0088] Specifically, when predicting the beginning and end positions of the main entity, character feature encoding, word-level feature encoding, and position feature encoding are input into the dynamic graph CNN (DGCCN) layer of the target extraction model for deep semantic analysis (i.e., encoding to obtain deep semantic information) to obtain the encoded sequence features, i.e., sequence feature encoding (which can be represented by, for example, H).
[0089] DGCCN has 10 layers.
[0090] Subsequently, the sequence feature encoding is input into the first multi-self-attention layer for feature encoding, and the output of the first multi-self-attention layer is input into the first Faster R-CNN+Dense layer for prediction to obtain the start and end positions of the main entity. In this way, inputting the sequence feature encoding into the first multi-self-attention layer enables semantic relationship modeling and global semantic information association. Then, inputting the output of the first multi-self-attention layer into the first Faster R-CNN+Dense layer yields the start and end positions of the main entity.
[0091] Specifically, the output of the first multi-self-attention layer is input into the first Faster R-CNN+Dense layer, and the "half-pointer-half-label" structure is used to predict the first and last positions of the main entity, thus obtaining the first and last positions of the main entity.
[0092] The first Faster R-CNN+Dense layer consists of a two-layer network structure consisting of Faster R-CNN and a fully connected Dense layer, which can further enhance the semantic features.
[0093] After obtaining the start and end positions of the main entity, the subsequence corresponding to the main entity in the sequence feature encoding is input into the BiGRU layer to obtain the encoded sequence of the main entity. The encoded sequence of the main entity and the relative position encoded sequence are then fused to obtain the target encoded sequence. The length of the target encoded sequence is the same as the length of the subsequence (corresponding to the main entity in the sequence feature encoding).
[0094] Finally, the sequence feature encoding is concatenated with the output of the second multi-self-attention layer, the target encoded sequence, and the prior features. This concatenation is then input into the second Faster R-CNN+Dense layer, and prediction is performed for any target relationship to obtain the head and tail positions of the object entity mapped to the main entity based on any target relationship.
[0095] That is, the sequence feature encoding is input into the second multi-self-attention layer, and the output is concatenated with the target encoded sequence and prior features to obtain concatenated features. Then, the concatenated features are input into the second Faster R-CNN+Dense layer. In this way, the prior features of the pre-trained model are integrated into the model's processing, which can further enhance semantic features while retaining the flexibility of character features.
[0096] If two entities in a sentence happen to be the main entity and the object entity of a triple in the knowledge base, then this triple is extracted as a candidate triple, thus obtaining the prior features.
[0097] Specifically, after inputting the concatenated features into the second Faster R-CNN+Dense layer, a "semi-pointer-semi-label" structure is constructed for each target relationship to predict the start and end positions of the corresponding object entity, thereby simultaneously predicting the object entity and the corresponding target relationship.
[0098] It should be noted that using a "half-pointer-half-label" structure during the key information extraction process can effectively handle situations involving multiple main entities (s), multiple object entities (p), or multiple relations (o), and can avoid incomplete extraction of key semantic features.
[0099] Furthermore, the target extraction model mentioned above also includes a classification layer, where the activation function is sigmoid instead of the traditional softmax function. Based on this, the model can encode information simply and efficiently, avoiding the situation where the extracted key semantic features are incomplete.
[0100] Step 103: Perform semantic analysis on the key semantic features of the target to obtain key information on substation defects.
[0101] Optionally, before performing the above method, model training is required to obtain the target extraction model.
[0102] In one possible implementation, historical substation defect data is first acquired and labeled. Then, based on the labeled historical substation defect data, and the principal and object entities mapped to the target relationship within the historical substation defect data, a preset extraction model is trained and adjusted to obtain the target extraction model.
[0103] In real-world data, there may be a significant number of missing subject and object entities (subject and object). Based on the above, it can be seen that when extracting key semantic features of a target based on the target extraction model, the missing key semantic features in the target substation defect data can also be obtained. In other words, for data with missing subject and object entities, the target extraction model can learn from the labeled substation defect data during model training, ultimately achieving the effect of completing the subject and object entities.
[0104] It should be noted that general information extraction mainly relies on named entity recognition (NAME) and then classifies the identified entities according to relationships. However, in substation defect data, there may be a situation where one primary entity corresponds to multiple secondary entities. General NAME recognition cannot effectively handle this situation, thus failing to meet the needs of substation defect management. Therefore, this paper considers using the concept of overall sequence labeling for key information extraction. Specifically, the implementation process of the key information extraction method for substation defects is as described above. Through the above process, this application can effectively solve the problem of omission in one-to-many and many-to-many entity extraction, and also effectively handles the situation of overlapping entities.
[0105] Secondly, this application employs a word-based feature fusion method. While using character annotations to avoid boundary segmentation errors, it effectively stores key information. Furthermore, during feature fusion, location features are combined for feature enhancement, which significantly reduces feature loss. Finally, compared to deep learning-based key information extraction methods, the model in this application has lower computational complexity and higher efficiency.
[0106] For example, the process for extracting key information about substation defects can be as follows: Figure 2As shown, substation defect data (or substation defect text) is acquired, and data cleaning and labeling are performed. Subsequently, the data is reviewed; if the review passes (Y), the target substation defect data is obtained; if the review fails (N), the data is re-labeled. Next, the target substation defect data is encoded to obtain character feature codes, word-level feature codes, and positional feature codes, which are then concatenated. On one hand, after concatenation, the data passes through a 10DGCNN layer, a first multi-self-attention layer, and a first Faster R-CNN+Dense layer to output the main entity s (its beginning and end positions). On the other hand, after concatenation, the data passes through a 10DGCNN layer. First, the sequence feature code output by the 10DGCNN layer is processed by BiGRU to obtain the s code (i.e., the encoded sequence of the main entity). Then, the sequence feature code, the output of the second multi-self-attention layer, the s code, and the relative position code sequence are input into the second Faster R-CNN+Dense layer for processing to obtain the target relation o and the object entity p.
[0107] An exemplary schematic diagram of the target extraction model structure is shown below. Figure 3 As shown, the acquired substation defect data undergoes data preprocessing, i.e., data cleaning. Subsequently, the data is first labeled through a shared encoding layer (including the aforementioned feature encoding layer and a 10-layer DGCNN model). Then, based on the feature encoding layer, a word-mixed embedding + position embedding is obtained and input into the 10-layer DGCNN model to obtain sequence feature encoding. Afterwards, the sequence feature encoding is processed by multi-self-attention and Faster R-CNN+Dense to extract 's', obtaining the main entity 's'. Furthermore, the encoded vector sequence (i.e., sequence feature encoding) is reused. The output obtained after inputting the sequence feature encoding into multi-self-attention is concatenated with the target encoding sequence and prior features, and then input into Faster R-CNN+Dense to extract 'o'. The target encoding sequence is the result of encoding the subsequence corresponding to 's' in the sequence feature encoding based on BiGRU, concatenated with the relative position features.
[0108] In summary, this application uses word-character hybrid embedding encoding, which effectively avoids boundary segmentation errors while storing key information. In the word-character hybrid encoding stage, the input text is first constructed as a character sequence, and after embedding encoding, a character vector sequence (i.e., character feature encoding) is obtained. Then, the input text is segmented into words, and a pre-trained word2vec is used to obtain word vectors (i.e., word-level feature encoding). The character vectors (i.e., character feature encoding) and word vectors (i.e., word-level feature encoding) are dimensionally transformed and aligned. Finally, the vectors (i.e., feature encodings) are concatenated to obtain a word-character hybrid vector (i.e., word-character hybrid feature encoding).
[0109] Furthermore, since convolutional neural networks and attention mechanisms are insensitive to positional features, and considering the value of positional features, this application encodes positional features and integrates them into the model features to enrich semantic features when predicting 's'. Specifically, in the positional feature encoding stage, the vector (i.e., feature encoding) is first initialized to obtain a feature with the same dimension as the word vector (i.e., word-level feature encoding). Then, the position ID is passed into the initialized vector, and the positional encoding is added before the word-word hybrid encoding to obtain a complete vector encoding. When predicting 'o' and 'p', the 's' features are BiGRU encoded to obtain a fixed-size feature, which is then concatenated into the original feature sequence as one of the conditions for predicting 'p' and 'o'. Considering that 'o' may be a word near 's', a "relative position vector" of the current position relative to the original position of 's' is added during feature concatenation, further improving the accuracy of 'p' and 'o' predictions.
[0110] Finally, in the process of extracting key information, in order to effectively handle cases with multiple main entities s, multiple object entities p, or multiple relations o, this application uses a "semi-pointer-semi-label" structure, employing the sigmoid activation function in the classification layer instead of the traditional softmax function. Based on this, the model can be encoded simply and efficiently.
[0111] like Figure 4 As shown in the figure, this application provides a device for extracting key information on substation defects. The device includes a labeling module 401, a model extraction module 402, and a semantic sorting module 403.
[0112] The annotation module 401 is used to annotate the substation defect data to obtain the target substation defect data.
[0113] The model extraction module 402 is used to input the target substation defect data into the target extraction model, and extract the target substation defect data using a "semi-pointer-semi-label" structure to obtain the target key semantic features. The target key semantic features include the key semantic features in the target substation defect data and the key semantic features missing in the target substation defect data.
[0114] The semantic analysis module 403 is used to perform semantic analysis on the target key semantic features to obtain key information on substation defects; the key information on substation defects includes the causes of substation defects and the solutions to substation defects.
[0115] like Figure 5 As shown in the figure, this application provides an electronic device, including a processor 501, a communication interface 502, a memory 503, and a communication bus 504, wherein the processor 501, the communication interface 502, and the memory 503 communicate with each other through the communication bus 504.
[0116] Memory 503 is used to store computer programs;
[0117] In one embodiment of this application, when the processor 501 executes the program stored in the memory 503, it implements the steps of the substation defect key information extraction method provided in any of the foregoing method embodiments.
[0118] This application also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the steps of the substation defect key information extraction method provided in any of the foregoing method embodiments.
[0119] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0120] The above description is merely a specific embodiment of the present invention, enabling those skilled in the art to understand or implement the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the present invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features claimed herein.
Claims
1. A method for extracting key information on substation defects, characterized in that, The method includes: The substation defect data is labeled to obtain the target substation defect data; The target substation defect data is input into the target extraction model, and the target substation defect data is extracted using a "semi-pointer-semi-label" structure to obtain the target key semantic features. The target key semantic features include the key semantic features in the target substation defect data and the key semantic features missing in the target substation defect data. The key semantic features of the target are the subject entity and object entity mapped based on the target relationship; the target relationship is the relationship involved in the historical substation defect data; The target substation defect data is input into the target extraction model, and a "semi-pointer-semi-label" structure is used to extract the target substation defect data to obtain the target key semantic features, including: The input target substation defect data is feature-encoded to obtain character feature codes, word-level feature codes, and location feature codes; Based on the character feature encoding, word-level feature encoding, and position feature encoding, using a "half-pointer-half-label" structure, the first and last positions of the main entity are predicted first, and then the first and last positions of the guest entity mapped to the main entity are predicted based on any target relationship. The target extraction model includes a feature encoding layer, a DGCNN layer, a first Faster R-CNN+Dense layer, a second Faster R-CNN+Dense layer, a first multi-self-attention layer, a second multi-self-attention layer, and a BiGRU layer. Based on the aforementioned character feature encoding, word-level feature encoding, and positional feature encoding, using a "semi-pointer-semi-label" structure, the first and last positions of the main entity are predicted first, and then the first and last positions of the object entity are predicted based on any target relationship, including: The character feature encoding, word-level feature encoding, and positional feature encoding are input into the DGCNN layer for deep semantic analysis to obtain sequence feature encoding. The sequence feature encoding is input into the first multi-self-attention layer for feature encoding, and the output of the first multi-self-attention layer is input into the first Faster R-CNN+Dense layer for prediction to obtain the beginning and end positions of the main entity. The subsequence corresponding to the main entity in the sequence feature encoding is input into the BiGRU layer to obtain the encoding sequence of the main entity. The encoding sequence of the main entity and the relative position encoding sequence are then fused to obtain the target encoding sequence. The length of the target encoding sequence is the same as the length of the subsequence. The sequence feature encoding output of the second multi-self-attention layer, the concatenated feature of the target encoding sequence and prior features are input into the second Faster R-CNN+Dense layer, and prediction is performed for any target relationship to obtain the first and last positions of the object entity mapped to the main entity based on any target relationship. Based on the beginning and end positions of the main entity and the beginning and end positions of the guest entity corresponding to any target relationship, key semantic features of the target are extracted from the target substation defect data to obtain the main entity and guest entity mapped based on any target relationship. The key semantic features of the target are semantically analyzed to obtain key information on substation defects; the key information on substation defects includes the causes of substation defects and the solutions to substation defects.
2. The method for extracting key information on substation defects according to claim 1, characterized in that, Before annotating the substation defect data to obtain the target substation defect data, the method further includes: Obtain raw substation defect data; Use a dedicated substation defect stop word list to remove stop words from the original substation defect data; The substation defect data is obtained by adjusting the errors in the original substation defect data using a target tool.
3. The method for extracting key information on substation defects according to claim 1, characterized in that, The process of annotating substation defect data to obtain target substation defect data includes: The first and second substation defect sequence data in the substation defect data are labeled to obtain the target substation defect data; The first substation defect sequence data represents the cause of the substation defect, and the second substation defect sequence data represents the solution to the substation defect; there is a corresponding relationship between the first substation defect sequence data and the second substation defect sequence data.
4. The method for extracting key information on substation defects according to claim 3, characterized in that, The step of annotating substation defect data to obtain target substation defect data also includes: Based on specialized terminology and grammar in the field of substation defects, the first substation defect sequence data and the second substation defect sequence data in the substation defect data were reviewed and adjusted.
5. The method for extracting key information on substation defects according to claim 1, characterized in that, The method further includes: Acquire historical substation defect data and mark the historical substation defect data; Based on the labeled historical substation defect data, the target extraction model is trained and adjusted by training the preset extraction model with the main entities and object entities in the historical substation defect data that are mapped based on the target relationship, so as to obtain the target extraction model.
6. A device for extracting key information on substation defects, characterized in that, The substation defect key information extraction device includes: The annotation module is used to annotate substation defect data to obtain target substation defect data; The model extraction module is used to input target substation defect data into a target extraction model, and extract the target substation defect data using a "semi-pointer-semi-label" structure to obtain target key semantic features. These target key semantic features include key semantic features already present in the target substation defect data and missing key semantic features. The target key semantic features are subject and object entities mapped based on target relationships. The target relationships are relationships involved in historical substation defect data. The process of inputting target substation defect data into the target extraction model and extracting the target key semantic features using a "semi-pointer-semi-label" structure includes: [details of input data would be inserted here]. The target substation defect data is feature-encoded to obtain character feature codes, word-level feature codes, and positional feature codes. Based on the character feature codes, word-level feature codes, and positional feature codes, a "semi-pointer-semi-label" structure is used to first predict the start and end positions of the main entity, and then, based on any target relationship, predict the start and end positions of the object entity mapped to the main entity. The target extraction model includes a feature encoding layer, a DGCNN layer, a first Faster R-CNN+Dense layer, a second Faster R-CNN+Dense layer, a first multi-self-attention layer, and a second multi-self-attention layer. The BiGRU layer, based on the character feature encoding, word-level feature encoding, and positional feature encoding, uses a "semi-pointer-semi-label" structure to first predict the beginning and end positions of the main entity, and then predict the beginning and end positions of the object entity based on any target relationship. This includes: inputting the character feature encoding, word-level feature encoding, and positional feature encoding into the DGCNN layer for deep semantic analysis to obtain sequence feature encoding; inputting the sequence feature encoding into the first multi-self-attention layer for feature encoding, and inputting the output of the first multi-self-attention layer into the first Faster R-CNN+Dense layer for pre-processing. The sequence feature encoding is used to obtain the first and last positions of the main entity. The subsequence corresponding to the main entity in the sequence feature encoding is input into the BiGRU layer to obtain the encoding sequence of the main entity. The encoding sequence of the main entity and the relative position encoding sequence are fused to obtain the target encoding sequence. The length of the target encoding sequence is the same as the length of the subsequence. The output of the sequence feature encoding in the second multi-self-attention layer, the concatenation feature of the target encoding sequence and the prior features are input into the second Faster R-CNN+Dense layer. For any target relationship, prediction is performed to obtain the first and last positions of the object entity mapped to the main entity based on any target relationship.Based on the beginning and end positions of the main entity and the beginning and end positions of the guest entity corresponding to any target relationship, key semantic features of the target are extracted from the target substation defect data to obtain the main entity and guest entity mapped based on any target relationship. The semantic analysis module is used to perform semantic analysis on the target key semantic features to obtain key information on substation defects; the key information on substation defects includes the causes of substation defects and the solutions to substation defects.
7. An electronic device, characterized in that, It includes a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus; Memory, used to store computer programs; When a processor executes a program stored in a memory, it implements the steps of the substation defect key information extraction method according to any one of claims 1-5.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the steps of the substation defect key information extraction method as described in any one of claims 1-5.