Method for automatically generating naming identification and annotation text of electric power data

By using a stacked encoder and decoder structure based on the Transformer model, a unified naming identifier and annotation text for power data are automatically generated, solving the problem of inconsistent power data naming and improving data management efficiency and accuracy.

CN121480508APending Publication Date: 2026-02-06GUANGXI POWER GRID CORP
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202410194009.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-02-21
Publication Date
2026-02-06

AI Technical Summary

Technical Problem

Existing technologies suffer from inconsistent and ambiguous naming issues in power data naming and identification, resulting in low data management efficiency. Furthermore, traditional methods are computationally inefficient and struggle to effectively utilize the parallel computing capabilities of GPUs.

Method used

A stacked encoder and decoder structure based on the Transformer model is adopted to build a named identifier extraction and annotation text generation model. Through deep learning, a unified named identifier and annotation text for power data are automatically extracted and generated. Multi-head attention mechanism and Softmax classification layer are used for feature extraction and probability calculation.

Benefits of technology

It improves the efficiency and accuracy of power data management, reduces the need for human resources, ensures that different personnel use a unified naming identifier for the same data, and enhances the consistency of data management.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121480508A_ABST
    Figure CN121480508A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of automatic management of power equipment, in particular to a method for automatically generating a power data naming identifier and annotation text, which comprises the following steps: S1, labeling a power text; s2, performing preprocessing operation on the text data; s3, constructing a naming identifier extraction model; S4, constructing an annotation text generation model; s5, splicing the naming identifier and the annotation text to form a naming identifier-annotation text pair; and finally, according to different approximate description texts of the same data input by different persons, calculating and matching the similarity with the extracted naming identifier to obtain a unified electric power data naming identifier. The problem that the naming identifiers are disordered and difficult to understand due to subjective preference differences of different managers is solved; according to the method provided by the invention, the high-quality unified naming identifier can be automatically generated, the annotation text of the naming identifier is generated, unified and normative data management is obtained, and human resources required for management are reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of power equipment automation management technology, specifically to a method for automatically generating naming identifiers and annotation text for power data. Background Technology

[0002] Text generation technology primarily refers to the process of learning from given text to generate new text that conforms to the rules of natural language. Text generation technology can help process the ever-increasing amount of text content and automatically generate text content needed in different fields.

[0003] People cannot intuitively perceive data, so they usually use text to describe it. Electricity data is typically stored in structured tables predefined by data managers, usually using table names, field names, and other textual identifiers as data attributes. Data naming identifiers generally reflect an intuitive description and understanding of the data. However, the subjective preferences of different managers may lead to problems such as inconsistent or ambiguous naming of the same data. In subsequent data management, misunderstandings of naming identifiers can result in low efficiency in the use and management of data.

[0004] Currently, the commonly used text recognition technology is named entity recognition in text. This transforms the extraction task into a classification task, assigning a label to each character in the text and determining whether each character belongs to a certain named entity and which part of the named entity it belongs to. This is used to identify named entities such as people's names, place names, and organization names in sentences, and is usually implemented using Hidden Markov Models or Conditional Random Fields.

[0005] The above methods have two major drawbacks: First, the named identifiers are not limited to named entities such as people and places, but can be used more broadly for short texts that describe and express information, usually appearing in the form of nouns, adjectives, verbs, or noun phrases. Second, commonly used methods such as Hidden Markov Models usually require manually designing features such as transition probabilities between observations and states, and observation probabilities. This requires specialized feature engineering tailored to the dataset and task, which is time-consuming and labor-intensive.

[0006] A Chinese patent document, CN201910533838.X, discloses a method for named entity recognition of power terms, comprising: acquiring power text information; inputting the power text information into a pre-trained word vector model to obtain a mapped text information vector with a preset dimension; inputting the text information vector into a pre-trained bidirectional long short-term memory network model to obtain bidirectional features of the text information vector; and inputting the bidirectional features into a pre-trained conditional random field model to output a tag sequence that conforms to semantic rules, thereby realizing entity recognition of power terms.

[0007] The Bidirectional Long Short-Term Memory (BiLSTM) network model used in the aforementioned patent documents is often used for tasks with strong temporal dependencies due to its sensitivity to the input order of temporal data. However, its model structure requires processing the input sequence sequentially step by step, passing the hidden layer state from the previous time step to the next, which makes it difficult to fully utilize the parallel computing capabilities of modern GPUs, resulting in low computational efficiency. Furthermore, when processing long sequences, BiLSTM needs to maintain a long historical information to capture long-term dependencies, which may lead to ineffective gradient propagation during backpropagation, potentially resulting in gradient vanishing or exploding problems. BiLSTM uses two long short-term memory networks in opposite directions to perform forward and backward computations on the sentence, obtaining two feature vectors which are then concatenated to form the final bidirectional feature. However, the feature vector obtained through concatenation cannot truly represent the contextual information. This invention uses a stacked encoder naming identifier extraction model based on the Transformer model, which can process the entire input sequence simultaneously without iterating step by step, thus improving computational efficiency. The attention mechanism in the encoder assigns different attention weights to different input parts, allowing the model to selectively focus on information that is more important to the current task, rather than considering all inputs equally, effectively mitigating the gradient propagation problem.

[0008] Named entity recognition typically refers to identifying entity information in text, while named identifier extraction refers to extracting semantically meaningful and understandable identifier information from text. Named entities can be considered a part of named identifiers. To better utilize data to generate value, data often needs to flow between different departments and personnel. However, the extracted named entities or named identifiers are usually short texts, which can be difficult for marketers outside their professional fields to understand. Therefore, it is often necessary to annotate the extracted identifiers. This invention proposes an annotated text generation model based on a Transformer stacked decoder structure. The model learns the contextual information of named identifiers and converts it into an output sequence of annotated text, achieving automatic annotation.

[0009] To address the aforementioned issues, based on relevant texts in the power sector, deep learning-based text extraction and generation technology is used to automatically generate unified and standardized text naming identifiers for power data, and to generate easily understandable naming identifier annotation texts, thereby reducing the human resources required for writing annotation texts. Summary of the Invention

[0010] The purpose of this invention is to provide a method for automatically generating naming identifiers and annotation text for power data, solving the problems of differentiated and ambiguous naming of power data. This method involves crawling scientific papers and professional articles in the power grid field using web crawlers; combining existing power system data and standards to extract naming identifiers from the text; generating annotations for the extracted naming identifiers based on the context, resulting in naming identifier-annotation text pairs; and finally, calculating and matching the similarity between different approximate descriptions of the same data input by different individuals and the extracted naming identifiers to obtain unified power data naming identifiers.

[0011] To achieve the above-mentioned technical objectives and effects, the present invention is implemented through the following technical solution:

[0012] A method for automatically generating naming identifiers and annotation text for power data includes the following steps:

[0013] S1: Annotate the power text to form a corpus containing named identifiers and annotated text;

[0014] S2: Perform preprocessing operations on the text data;

[0015] S3: Construct a named identifier extraction model and train it until the model converges; input the preprocessed text from S2 into the named identifier extraction model; the named identifier extraction model uses an encoder to encode the semantic information, part-of-speech information, and positional information of the input text, extracts the contextual features of the text, calculates the probability through a Softmax classification layer, and outputs the named identifier;

[0016] S4: Construct an annotation text generation model and train it until the model converges; input the named identifiers obtained in S3 into the annotation text generation model, which encodes the input into a semantic vector, and obtains the semantic vector of the output text through a decoder; map the semantic vector into a score vector of the output text through a linear layer and a softmax layer; calculate the score vector using the Beam Search algorithm to obtain the annotation text;

[0017] S5: Concatenate the named identifier with the annotation text to form a named identifier-annotation text pair; convert the input text from different people into word vectors; calculate the similarity between the vector and the named identifier, and return the closest named identifier-annotation text pair.

[0018] Furthermore, step S1 specifically includes: crawling scientific and technological papers in the field of power from CNKI and Wanfang platforms, storing the crawled documents in a text library; and annotating the crawled data and power texts provided by power operation departments to form a corpus containing named identifiers and annotated texts.

[0019] Furthermore, step S2 specifically includes: defining a dictionary that maps text to numbers;

[0020] Preprocess the text, remove punctuation marks, remove meaningless punctuation marks and common words such as "de" and "le"; truncate long sentences and complete short sentences; add start and end identifiers at the beginning and end of the sentences.

[0021] Segment the text using a hybrid word segmentation method based on rules and statistics, and preserve the order of the words.

[0022] Define a词性表 (word type table), assign 1 - 12 as the corresponding indexes for nouns, verbs, adjectives, numerals, quantifiers, pronouns, prepositions, auxiliary words, adverbs, conjunctions, interjections, and onomatopoeias; store the词性标注数据 (word type annotation data) in the form of a two-dimensional matrix [word index, word type index].

[0023] Perform word type annotation on the text vocabulary of the power text to obtain a word type feature vector.

[0024] Further, the step S3 specifically includes: The named entity extraction model consists of an embedding layer, six encoder layers, a feature extraction layer, and a classification layer.

[0025] First, look up the word ID of the input text sequence in the word table, map the word ID into a 512 - dimensional numerical vector through word embedding, add the position vector obtained through position encoding, and finally add the word type vector to obtain the final word vector, and input it into the encoding layer. The formula for the position encoding vector is as follows:

[0026]

[0027]

[0028] where pos refers to the position of the word in the input sequence, i represents the dimension of the position encoding vector, and d model represents the dimension of the model.

[0029] The encoding layer consists of a multi - head attention layer and a forward feedback layer. Multiply the three word vector matrices Q, K, and V output by the embedding layer with the parameter matrices W Q , W K , W V respectively to obtain the Q', K', and V' matrices. Divide the Q', K', and V' matrices into sub - blocks and calculate 8 attention head vectors head i through the attention mechanism. Concatenate the attention head vectors into a matrix and multiply it with the parameter matrix W O to obtain the attention word vector matrix. [[ID=4E]]

[0030]

[0031] where, d k It should be noted that the "词性表" and "词性标注数据" in the translation are placeholders as there is no clear equivalent in English in the context. You may need to provide more context or clarify these terms for a more accurate translation.Here, 512 represents the dimension of the word vector, and the Softmax function is a normalization function that maps numerical values ​​to probabilities.

[0032]

[0033] MultiHead(Q,K,V)=Concat(h1,h2,…,h n W O

[0034] Multi-head attention maps input vectors to different subspaces, enabling the model to learn information from different dimensions of word vectors and pay attention to the relationships between different word vectors. The resulting multi-head attention word vector matrix incorporates the relationship information between words.

[0035] Residual connections are used between layers. The input and output of a layer are added together, normalized, and then input into the next layer.

[0036] Output=LayerNorm(input+frontLayer(output))

[0037]

[0038] Where μ j σ is the mean. j For variance;

[0039] The feedforward layer consists of two layers of feedforward neural networks. The first layer has 4 neurons and uses the ReLU activation function, while the second layer has 512 neurons and does not use an activation function. The calculation formula is as follows:

[0040] FFN(x) = max(0, xW1+b1)W2+b2

[0041] The encoder's output is the semantic vector of the input text with attention added. This vector is then fed into a fully connected layer for feature extraction, and finally into a classification layer to predict a label for each word and determine whether it is a named identifier.

[0042] Furthermore, step S4 specifically includes: the encoder is the same as in step S3;

[0043] The text annotation generation model consists of an embedding layer, six stacked decoding layers, a linear layer, and a softmax layer. The embedding layer is consistent with step S3. The first layer of the decoding layer is a masked attention layer, which uses a mask to cover the subsequent text at the current time step, only calculating the attention of the preceding text. Q·K is then calculated. T Then, the upper right triangular region of the matrix is ​​set to zero, and then Softmax is used for calculation.

[0044] The second layer is the cross-attention layer, with input matrices K and V from the encoder output and input matrix Q from the output of the previous layer. It is used to calculate the degree of correlation between the annotation text input to the decoder and the named identifier input to the encoder.

[0045] The feedforward layer of the decoding layer also consists of two fully connected networks, consistent with the coding layer.

[0046] The output of the linear layer is converted into a probability distribution through the Softmax layer.

[0047] The Beam Search algorithm was used to calculate the top k highest-scoring annotation texts.

[0048] Continue until the end-of-output symbol is displayed.

[0049] Furthermore, step S5 specifically includes: using the Sentence BERT model to calculate the similarity between the input text and the named identifiers, and returning the five named identifiers with the highest similarity. The named identifier with the highest similarity score and its corresponding annotation text are then assigned to the input text to achieve the purpose of unifying the named identifiers.

[0050] The beneficial effects of this invention are:

[0051] This invention utilizes deep learning-based text extraction and generation techniques to construct a naming identifier extraction model and an annotation text generation model based on a corpus of power data. The naming identifier extraction model encodes and classifies power data, extracting unified naming identifiers. Compared to traditional rule-based and statistical methods, this invention automatically learns features through a deep learning model, eliminating the limitations of manual rules and extracting naming identifiers more accurately. The annotation text generation model generates easily understandable annotation text from the extracted naming identifiers, ensuring accurate description and naming of power data.

[0052] In this invention, power-related text undergoes preprocessing to remove meaningless punctuation and common words, followed by word segmentation and part-of-speech tagging. This preprocessing reduces data processing complexity and noise, improving the training performance of subsequent models. Simultaneously, this invention utilizes deep learning models to construct a named identifier extraction model and an annotation text generation model, and trains these models to automatically generate named identifiers and annotation text. Compared to traditional manual creation of identifiers and annotations, this invention saves significant human resources and time, improving data management efficiency.

[0053] This invention accurately describes power data by automatically generating named identifiers and annotation text. Through a deep learning model, it learns semantic information, part-of-speech information, and contextual features from power data to extract named identifiers more accurately. Simultaneously, an annotation text generation model generates easily understandable annotation text from the extracted named identifiers, improving the accurate understanding and use of power data.

[0054] By performing similarity matching with approximate descriptive text input by different individuals, this invention can automatically extract the most similar named identifiers and annotation text. The similarity matching utilizes the Sentence BERT model to calculate the similarity between the input text and the extracted named identifiers, selecting the closest named identifiers and annotation texts based on the similarity results. This ensures that different personnel use consistent named identifiers for the same data, improving the consistency of data management.

[0055] In summary, this invention solves the problems of differentiated and ambiguous naming of power data by using deep learning-based text extraction and generation technology, improving data management efficiency and accuracy, and enhancing the uniformity of naming identifiers. It automatically generates high-quality, unified naming identifiers and corresponding annotation text, resulting in standardized data management and reducing the human resources required for management.

[0056] Of course, any product implementing this invention does not necessarily need to achieve all of the advantages described above at the same time. Attached Figure Description

[0057] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0058] Figure 1 This is a structural diagram of the method model of the present invention;

[0059] Figure 2 This is a flowchart of the method of the present invention. Detailed Implementation

[0060] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0061] Example 1

[0062] A method for automatically generating naming identifiers and annotation texts for power data according to this embodiment includes the following steps:

[0063] S1: Annotate the power text to form a corpus containing naming identifiers and annotation texts;

[0064] S2: Perform preprocessing operations on the text data;

[0065] S3: Construct a naming identifier extraction model and train it until the model converges; input the preprocessed text in S2 into the naming identifier extraction model; the naming identifier extraction model uses an encoder to encode the semantic information,词性 information, and position information of the input text, extracts the context features of the text, calculates probabilities through a Softmax classification layer, and outputs naming identifiers;

[0066] S4: Construct an annotation text generation model and train it until the model converges; input the naming identifiers obtained in S3 into the annotation text generation model, which encodes the input into a semantic vector and obtains the semantic vector of the output text through a decoder; maps the semantic vector to a score vector of the output text through a linear layer and a Softmax layer; calculates the score vector through the Beam Search algorithm to obtain the annotation text;

[0067] S5: Concatenate the naming identifiers and annotation texts to form naming identifier-annotation text pairs; convert the input texts of different personnel into word vectors; calculate the similarity with the naming identifiers and return the closest naming identifier-annotation text pairs.

[0068] In this embodiment, the step S1 specifically includes: Crawl scientific and technological papers in the power field from CNKI and Wanfang platforms, and store the crawled documents in a text library; annotate the crawled data and the power texts provided by the power operation department to form a corpus containing naming identifiers and annotation texts.

[0069] In this embodiment, the step S2 specifically includes: Define a dictionary that maps words to numbers;

[0070] Preprocess the text, remove punctuation marks, remove meaningless punctuation marks and common words such as "的" and "了"; truncate long sentences and补齐 short sentences; add start and end identifiers at the beginning and end of the sentence;

[0071] Perform word segmentation on the text using a hybrid word segmentation method based on rules and statistics, and retain the order of the words.

[0072] It should be noted that the term "词性" in the original text seems to be a misspelling. It might be "词性" (lexical category). If this is an error, please correct it according to the actual situation. Also, the term "补齐" in the original text is not a standard Chinese word. It might be a local or incorrect expression. I translated it as "补齐" as it is, but it might need further clarification or correction.A part-of-speech (POS) table is defined, assigning nouns, verbs, adjectives, numerals, classifiers, pronouns, prepositions, auxiliary words, adverbs, conjunctions, interjections, and onomatopoeias with indices 1-12. In this invention, words with a POS value of 1 are nouns, and the POS tagging data is stored in a two-dimensional matrix [word index, POS index].

[0073] Part-of-speech tagging is performed on the vocabulary of the power text to obtain part-of-speech feature vectors.

[0074] In this embodiment, step S3 specifically includes: the named identifier extraction model consists of an embedding layer, six encoder layers, a feature extraction layer, and a classification layer.

[0075] First, the word IDs of the input text sequence are obtained by looking up the vocabulary. Then, word embeddings are used to map these word IDs into 512-dimensional numerical vectors. These are then added to the positional vectors obtained through positional encoding, and finally, part-of-speech tagging is added to obtain the final word vectors, which are then input into the encoding layer. The formula for calculating the positional encoding vector is as follows:

[0076]

[0077]

[0078] Where pos refers to the position of the word in the input sequence, i represents the dimension of the position encoding vector, and d model Indicates the dimension of the model.

[0079] The encoding layer consists of a multi-head attention layer and a feedforward layer. The three word vector matrices Q, K, and V output from the embedding layer are then compared with the parameter matrix W. Q W K W V Multiplying these matrices yields matrices Q', K', and V'. These matrices are then divided into sub-blocks, and eight attention head vectors are calculated using an attention mechanism. i The attention head vectors are concatenated into a matrix and then combined with the parameter matrix W. O Multiplying them yields the attention word vector matrix.

[0080]

[0081] Where, d k Here, 512 represents the dimension of the word vector, and the Softmax function is a normalization function that maps numerical values ​​to probabilities.

[0082]

[0083] MultiHead(Q,K,V)=Concat(h1,h2,…,h n W O

[0084] Multi-head attention maps input vectors to different subspaces, enabling the model to learn information from different dimensions of word vectors and pay attention to the relationships between different word vectors. The resulting multi-head attention word vector matrix incorporates the relationship information between words.

[0085] Residual connections are used between layers. The input and output of a layer are added together, normalized, and then input into the next layer.

[0086] Output=LayerNorm(input+frontLayer(output))

[0087]

[0088] Where μ j σ is the mean. j For variance;

[0089] The feedforward layer consists of two layers of feedforward neural networks. The first layer has 4 neurons and uses the ReLU activation function, while the second layer has 512 neurons and does not use an activation function. The calculation formula is as follows:

[0090] FFN(x)=max(0 ,x W1+b1)W2+b2

[0091] The encoder's output is the semantic vector of the input text with attention added. This vector is then fed into a fully connected layer for feature extraction, and finally into a classification layer to predict a label for each word and determine whether it is a named identifier.

[0092] In this embodiment, step S4 specifically includes: the encoder is the same as in step S3;

[0093] The text annotation generation model consists of an embedding layer, six stacked decoding layers, a linear layer, and a softmax layer. The embedding layer is consistent with previous models. The first layer of the decoding layer is a masked attention layer. To allow the model to predict the following text from the preceding text, the model cannot see the complete sequence. Therefore, a mask is used to cover the following text at the current time step, only calculating the attention of the preceding text. This is done before calculating Q·K. T Then, the upper right triangular region of the matrix is ​​set to zero, and then Softmax is used for calculation.

[0094] The second layer is the cross-attention layer, with input matrices K and V from the encoder output and input matrix Q from the output of the previous layer. It is used to calculate the degree of correlation between the annotation text input to the decoder and the named identifier input to the encoder.

[0095] The feedforward layer of the decoding layer also consists of two fully connected networks, consistent with the coding layer.

[0096] The output of the linear layer is converted into a probability distribution through the Softmax layer.

[0097] The Beam Search algorithm was used to calculate the top k highest-scoring annotation texts.

[0098] Continue until the end-of-output symbol is displayed.

[0099] In this embodiment, step S5 specifically includes: using the Sentence BERT model to calculate the similarity between the input text and the named identifiers, and returning the five named identifiers with the highest similarity. The named identifier with the highest similarity score and its corresponding annotation text are then assigned to the input text to achieve the purpose of unifying the named identifiers.

[0100] Example 2

[0101] Examples of named identifier extraction and text annotation generation

[0102] The text "Three-level DC / DC converters often employ phase-shifted ZVS control. However, conventional phase-shifted ZVS control makes it difficult to achieve ZVS in the lag arm, and circulating current during commutation reduces converter efficiency. Therefore, this paper proposes a ZVS-ZCS three-level DC / DC converter with a current-doubling rectifier circuit. The resonant capacitor for achieving ZCS in the lag arm is designed in the secondary current-doubling rectifier circuit, effectively overcoming the influence of circulating current and reducing voltage stress on the rectifier diodes." is preprocessed, segmented, and embedded to obtain a word vector matrix. This matrix is ​​then added to the position vector and part-of-speech vector to obtain the input vector for the encoder in the naming identifier extraction model. A stacked encoder structure based on an attention mechanism assigns higher weights to task-related key information, resulting in a word vector matrix that incorporates contextual information, better expressing the semantic information of the text. After feature extraction through two fully connected layers, the naming identifiers "three-level DC / DC converter," "current-doubling rectifier circuit," and "rectifier diode voltage stress" are output.

[0103] The obtained named identifier "current multiplier rectifier circuit" undergoes the same preprocessing, word segmentation, and word embedding processes before being passed to the decoder of the text annotation generation model. The decoder first initializes its internal state by receiving the encoder's context vector and generates the first start tag of the sequence. <start>The output token is re-inputted into the decoder, and the next word is generated by randomly sampling from the probability distribution of candidate words using a multinomial sampling method. The generated word is added to the original input sequence of the decoder to form a new context. This process is repeated until a termination token is encountered. <end>The final output will be the annotation text: "A current-doubler rectifier circuit is a rectifier circuit used in DC power supplies, in which two rectifier elements share the same load. The purpose is to reduce the conduction losses of the rectifier elements, thereby improving the efficiency of the power supply system. It is often used in high-current and high-power applications, such as power electronic systems." The naming identifier will be bound to the annotation text.

[0104] Using the Sentence Bert model, the similarity between the input text and the named identifier is calculated, and the named identifier with the highest similarity score and its corresponding annotation text are assigned to the input text.

[0105] The preferred embodiments of the present invention disclosed above are merely illustrative of the invention. These preferred embodiments do not exhaustively describe all details, nor do they limit the invention to the specific implementations described. Clearly, many modifications and variations can be made based on the content of this specification. This specification selects and specifically describes these embodiments to better explain the principles and practical applications of the invention, thereby enabling those skilled in the art to better understand and utilize the invention. The invention is limited only by the claims and their full scope and equivalents.< / end> < / start>

Claims

1. A method for automatically generating naming identifiers and annotation text for power data, characterized in that, It includes the following steps: S1: Annotate the power text to form a corpus containing named identifiers and annotation texts; S2: Perform preprocessing operations on the text data; S3: Build a named identifier extraction model and train it until the model converges; input the preprocessed text in S2 into the named identifier extraction model; the named identifier extraction model uses an encoder to encode the semantic information,词性 information, and position information of the input text, extracts the context features of the text, calculates probabilities through a Softmax classification layer, and outputs named identifiers; S4: Build an annotation text generation model and train it until the model converges; input the named identifiers obtained in S3 into the annotation text generation model, which encodes the input into a semantic vector and obtains the semantic vector of the output text through a decoder; maps the semantic vector to a score vector of the output text through a linear layer and a Softmax layer; calculates the score vector through the Beam Search algorithm to obtain the annotation text; S5: Concatenate the named identifier and the annotation text to form a named identifier-annotation text pair; convert the input texts of different persons into word vectors; calculate the similarity with the named identifier and return the closest named identifier-annotation text pair.

2. The method for automatically generating naming identifiers and annotation text for power data as described in claim 1, characterized in that: The specific steps of S1 include: Crawl scientific and technological papers in the power field from CNKI and Wanfang platforms, and store the crawled documents in a text library; annotate the crawled data and the power texts provided by the power operation department to form a corpus containing named identifiers and annotation texts.

3. The method for automatically generating naming identifiers and annotation text for power data as described in claim 1, characterized in that: The specific steps of S2 include: Define a dictionary that maps words to numbers; Preprocess the text, remove punctuation marks, remove meaningless punctuation marks and common words such as "的" and "了"; truncate long sentences and complete short sentences; add start and end identifiers at the beginning and end of the sentence; Segment the text using a hybrid word segmentation method based on rules and statistics, and retain the order of the words; Define a词性 table, assign 1-12 as the corresponding indexes to nouns, verbs, adjectives, numerals, quantifiers, pronouns, prepositions, auxiliary words, adverbs, conjunctions, interjections, and onomatopoeias; store the词性 annotation data in the form of a two-dimensional matrix [word index,词性 index]; Perform词性 annotation on the text vocabulary of the power text to obtain a词性 feature vector.

4. The method for automatically generating naming identifiers and annotation text for power data as described in claim 1, characterized in that: The specific steps of S3 include: The named identifier extraction model consists of an embedding layer, six encoder layers, two feature extraction layers, and a classification layer; First, look up the word table to obtain the word IDs of the input text sequence, map the word IDs into 512-dimensional numerical vectors through word embedding, add the position vectors obtained through position encoding, and finally add the词性 vector to obtain the final word vector and input it into the encoding layer; where the calculation formula of the position encoding vector PE is as follows: Where pos refers to the position of the word in the input sequence, i represents the dimension of the position encoding vector, and d model Indicates the dimension of the model; The encoding layer consists of a multi-head attention layer and a feedforward layer; the three word vector matrices Q, K, and V output from the embedding layer are respectively coupled with the parameter matrix W. Q W K W V Multiplying these matrices yields matrices Q', K', and V'. These matrices are then divided into sub-blocks, and eight attention head vectors are calculated using an attention mechanism. i The attention head vectors are concatenated into a matrix and then combined with the parameter matrix W. O Multiplying them yields the attention word vector matrix; Where, d k Here, 512 represents the dimension of the word vectors, and the Softmax function is a normalization function that maps numerical values ​​to probabilities. MultiHead(Q,K,V)=Concat(h1,h2,…,h n )W O The multi-head attention mechanism maps the input vector to different subspaces, enables the model to learn information in different dimensions of the word vector, pays attention to the associations between different word vectors, and finally the obtained multi-head attention word vector matrix incorporates the association information between words; Use residual connections between layers, add the input of this layer and the output of this layer, normalize it, and then input it into the next layer; Output=LayerNorm(input+frontLayer(output)) Where μ j σ is the mean. j For variance; The feedforward layer consists of two layers of feedforward neural networks. The first layer has 4 neurons and uses the ReLU activation function, while the second layer has 512 neurons and does not use an activation function. The calculation formula is as follows: FFN(x) = max(0, xW1+b1)W2+b2 The encoder's output is the semantic vector of the input text with attention added. This vector is then fed into a fully connected layer for feature extraction, and finally into a classification layer to predict a label for each word and determine whether it is a named identifier.

5. The method for automatically generating naming identifiers and annotation text for power data as described in claim 1, characterized in that: Step S4 specifically includes: the encoder is the same as in step S3; The text annotation generation model consists of an embedding layer, six stacked decoding layers, a linear layer, and a softmax layer. The embedding layer is consistent with step S3. The first layer of the decoding layer is a masked attention layer, which uses a mask to cover the subsequent text at the current time step, only calculating the attention of the preceding text. Q·K is then calculated. T Then, the upper right triangular region of the matrix is ​​set to zero, and then Softmax is used for calculation. The second layer is the cross-attention layer, with input matrices K and V from the encoder output and input matrix Q from the output of the previous layer; it is used to calculate the degree of correlation between the annotation text input to the decoder and the named identifier input to the encoder. The feedforward layer of the decoding layer also consists of two fully connected networks, consistent with the coding layer; The output of the linear layer is converted into a probability distribution through the Softmax layer; The Beam Search algorithm was used to calculate and obtain the top k highest-scoring annotation texts; Continue until the end-of-output symbol is displayed.

6. The method for automatically generating naming identifiers and annotation text for power data as described in claim 1, characterized in that: Step S5 specifically includes: using the Sentence Bert model to calculate the similarity between the input text and the named identifiers, and returning the five named identifiers with the highest similarity; assigning the named identifier with the highest similarity score and its corresponding annotation text to the input text to achieve the purpose of unifying the named identifiers.

Citation Information

Patent Citations

  • Power term named entity identification method and device

    CN110232192A