Entity recognition method and device for power dispatching text and electronic equipment
By combining BERT, BiLSTM, and HAM models with CRF, a power dispatch text entity recognition method was developed, which solved the problem of inaccurate entity recognition in power dispatch text and achieved high-precision entity recognition and decision support.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- STATE GRID BEIJING ELECTRIC POWER CO
- Filing Date
- 2026-01-30
- Publication Date
- 2026-05-05
AI Technical Summary
Existing power dispatch text entity recognition technologies cannot effectively cope with complex semantic changes and the diversity of technical terms, resulting in inaccurate recognition results. Furthermore, the rule design is cumbersome and the coverage is limited.
We employ a BERT-based model for segmentation unit encoding, combined with BiLSTM and hierarchical attention mechanism (HAM) to process power dispatch text, and utilize a CRF model for entity label constraints to achieve high-precision entity recognition of power dispatch text.
It improves the accuracy and efficiency of entity recognition in power dispatch text, enabling it to better handle complex power dispatch text, identify key entity information, and support real-time decision-making in intelligent power dispatch systems.
Smart Images

Figure CN121981121A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of power systems, and more specifically, to a method, apparatus, and electronic device for entity recognition of power dispatch text. Background Technology
[0002] With the continuous innovation and development of new power systems, the industry is expanding rapidly, gradually evolving into a modern industry integrating high technological barriers, wide coverage, and multidisciplinary integration. Simultaneously, the scale and complexity of power systems continue to rise, especially in the field of power dispatching, generating and relying on massive amounts of professional textual information such as regulations, reports, and logs daily. These texts are not only the direct basis for dispatching decisions but also important carriers of industry knowledge. Traditionally, the processing of this information relies on manual reading and understanding, which is inefficient and prone to errors. Automated entity recognition technology can quickly and accurately extract key entity information from these texts, such as equipment, operating instructions, and fault states, thereby significantly improving the efficiency and accuracy of dispatching decisions and facilitating real-time monitoring and rapid response to various conditions in the power system.
[0003] Existing technologies that use rule-based methods to identify entities in power dispatch texts cannot handle the complex semantic variations and diverse terminology within these texts. Furthermore, as the number of entity types and the relationships between entities increase, rule design becomes extremely cumbersome and fails to cover all possible entity combinations, resulting in poor flexibility, limited coverage, and insufficient accuracy. Consequently, the entity recognition results often exhibit significant errors. Therefore, these technologies suffer from inaccurate entity recognition results in power dispatch texts.
[0004] There is currently no effective solution to the above problems. Summary of the Invention
[0005] This application provides a method, apparatus, and electronic device for entity recognition of power dispatch text, so as to at least solve the technical problem of inaccurate entity recognition results of power dispatch text in related technologies.
[0006] According to one aspect of the embodiments of this application, a method for entity recognition of power dispatch text is provided, comprising: determining initial feature vectors corresponding to multiple segmentation units based on target power dispatch text, wherein the multiple segmentation units are obtained by segmenting the target power dispatch text; modifying the initial feature vectors corresponding to the multiple segmentation units respectively to obtain target feature vectors corresponding to the multiple segmentation units respectively; determining entity label score vectors corresponding to the multiple segmentation units based on the target feature vectors corresponding to the multiple segmentation units respectively, wherein the entity label score vectors are used to indicate the degree of matching between the corresponding segmentation unit and preset entity labels, the entity being a word in the target power dispatch text, and each entity corresponding to at least one segmentation unit; determining target entity label vectors of the target power dispatch text based on the entity label score vectors corresponding to the multiple segmentation units respectively, wherein the target entity label vectors are composed of target entity labels corresponding to the multiple segmentation units respectively; and determining target entity recognition results of the target power dispatch text based on the target entity label vectors, wherein the target entity recognition results are used to describe the entity categories corresponding to the multiple entities included in the target power dispatch text respectively.
[0007] According to another aspect of the embodiments of this application, an entity recognition device for power dispatch text is provided, comprising: a first determining module, configured to determine initial feature vectors corresponding to multiple segmentation units based on the target power dispatch text, wherein the multiple segmentation units are obtained by segmenting the target power dispatch text; a target feature vector determining module, configured to modify the initial feature vectors corresponding to the multiple segmentation units respectively to obtain target feature vectors corresponding to the multiple segmentation units respectively; a second determining module, configured to determine entity label score vectors corresponding to the multiple segmentation units based on the target feature vectors corresponding to the multiple segmentation units respectively, wherein the entity label score vectors are used to indicate the degree of matching between the corresponding segmentation unit and the preset entity label, the entity being a word in the target power dispatch text, and each entity corresponding to at least one segmentation unit; a third determining module, configured to determine a target entity label vector of the target power dispatch text based on the entity label score vectors corresponding to the multiple segmentation units respectively, wherein the target entity label vector is composed of target entity labels corresponding to the multiple segmentation units respectively; and a fourth determining module, configured to determine a target entity recognition result of the target power dispatch text based on the target entity label vectors, wherein the target entity recognition result is used to describe the entity categories corresponding to the multiple entities included in the target power dispatch text respectively.
[0008] According to another aspect of the embodiments of this application, a non-volatile storage medium is provided, which stores multiple instructions, any one of which is adapted to be loaded and executed by a processor for an entity recognition method of power dispatch text.
[0009] According to another aspect of the embodiments of this application, an electronic device is provided, including: one or more processors and a memory, the memory being used to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors cause the one or more processors to implement any one of the entity recognition methods for power dispatch text.
[0010] According to another aspect of the embodiments of this application, a computer program product is provided, which, when executed on a data processing device, is a program adapted to perform entity recognition method steps for power dispatch text.
[0011] In this embodiment, based on the target power dispatch text, initial feature vectors corresponding to multiple segmentation units are determined, wherein the multiple segmentation units are obtained by segmenting the target power dispatch text. The initial feature vectors corresponding to the multiple segmentation units are then corrected to obtain target feature vectors corresponding to the multiple segmentation units. Based on the target feature vectors corresponding to the multiple segmentation units, entity label score vectors corresponding to the multiple segmentation units are determined, wherein the entity label score vectors indicate the degree of matching between the corresponding segmentation unit and preset entity labels. Entities are words in the target power dispatch text, and each entity corresponds to at least one segmentation unit. Based on the entity label score vectors corresponding to the multiple segmentation units, target entity label vectors of the target power dispatch text are determined, wherein the target entity label vectors are composed of target entity labels corresponding to the multiple segmentation units. Based on the target entity label vectors, target entity recognition results of the target power dispatch text are determined, wherein the target entity recognition results describe the entity categories corresponding to the multiple entities included in the target power dispatch text. The goal is to segment and process the target power dispatch text to obtain multiple segmentation units, and then combine the entity label score vectors corresponding to the multiple segmentation units to determine the target entity recognition result of the target power dispatch text. This achieves the technical effect of improving the accuracy of the target entity recognition result of the target power dispatch text, and thus solves the technical problem of inaccurate entity recognition results of power dispatch text in related technologies. Attached Figure Description
[0012] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:
[0013] Figure 1 This is a flowchart of an entity recognition method for power dispatch text provided according to an embodiment of this application;
[0014] Figure 2 This is a flowchart of an optional entity recognition method for power dispatch text provided according to an embodiment of this application;
[0015] Figure 3 This is a schematic diagram of an optional BERT pre-trained language model provided according to an embodiment of this application;
[0016] Figure 4 This is a schematic diagram of an optional BiLSTM model provided according to an embodiment of this application;
[0017] Figure 5 This is a schematic diagram of an optional entity recognition device for power dispatch text provided according to an embodiment of this application. Detailed Implementation
[0018] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.
[0019] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0020] According to an embodiment of this application, a method embodiment for entity recognition of power dispatch text is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.
[0021] Figure 1 This is a flowchart of an entity recognition method for power dispatch text provided in an embodiment of this application, such as... Figure 1 As shown, the method includes the following steps:
[0022] Step S102: Based on the target power dispatch text, determine the initial feature vectors corresponding to multiple segmentation units, wherein the multiple segmentation units are obtained by segmenting the target power dispatch text;
[0023] The process involves segmenting the target power dispatch text into multiple segments, encoding each segment to obtain its corresponding initial feature vector. Encoding these segments converts the target power dispatch text into a vector representation that the model can understand, laying the foundation for subsequent entity recognition.
[0024] In one optional embodiment, based on the target power dispatch text, the initial feature vectors corresponding to multiple segmentation units are determined, including: encoding the multiple segmentation units respectively to obtain feature vector sets corresponding to the multiple segmentation units, wherein the feature vector sets include semantic feature vectors, fragment feature vectors, and location feature vectors of the corresponding segmentation units; for any segmentation unit among the multiple segmentation units, the semantic feature vectors, fragment feature vectors, and location feature vectors of any segmentation unit are fused to obtain a fused feature vector of any segmentation unit; the spliced feature vector of any segmentation unit is corrected to obtain the initial feature vector of any segmentation unit; and the initial feature vectors corresponding to the multiple segmentation units are determined by using the method of determining the initial feature vector of any segmentation unit.
[0025] It can be understood that multiple segmentation units are encoded separately to obtain feature vector sets corresponding to each segmentation unit. These feature vector sets include the semantic feature vector, fragment feature vector, and positional feature vector of the corresponding segmentation unit. For any segmentation unit among the multiple segmentation units, the semantic feature vector, fragment feature vector, and positional feature vector of that segmentation unit are fused to obtain a fused feature vector for that segmentation unit. The fused feature vector of any segmentation unit is then corrected to obtain an initial feature vector for that segmentation unit. The initial feature vectors corresponding to multiple segmentation units are determined using the above method. By fusing the semantic feature vector, fragment feature vector, and positional feature vector, the initial feature vector can better reflect the true context of the segmentation unit, improving the accuracy of the target entity recognition results.
[0026] Optionally, the BERT (Bidirectional Encoder Representations from Transformers) model can be used to determine the aforementioned initial feature vectors. The BERT model is a language representation model that encodes natural language. Through a bidirectional Transformer architecture and masked language mechanism, it can effectively solve the problems of ambiguity and context dependence of power terms in the target power dispatching text, achieving dynamic parsing and accurate understanding of power terms. The role of the BERT model is to transform the input target power dispatching text into a set of vector representations, namely, initial feature vectors corresponding to multiple segmentation units, where each initial feature vector incorporates global information from the target power dispatching text.
[0027] First, the target power dispatch text is input and segmented to obtain n segmentation units. These n segmentation units constitute a text sequence. The above n segmentation units are encoded to obtain multi-class feature vectors for each segmentation unit, including semantic feature vectors (Token Embeddings), segment feature vectors (Segment Embeddings), and position feature vectors (Position Embeddings). The semantic feature vectors reflect the semantic information of each segmentation unit; the segment feature vectors distinguish the sentence to which each segmentation unit belongs when the input target power dispatch text contains two sentences (e.g., in a question-and-answer task); and the position feature vectors represent the position of each segmentation unit in the target power dispatch text. Based on the semantic feature vectors, segment feature vectors, and position feature vectors, the fused feature vector of the segmentation unit is obtained. The fused feature vector of the m-th (m=1,2,…,n) segmentation unit is... The following methods can be used to determine this:
[0028]
[0029] in, Let m be the semantic feature vector of the m-th segmentation unit. Let be the segment feature vector of the m-th segmentation unit. Let be the positional feature vector of the m-th segmentation unit.
[0030] Optionally, the fused feature vectors corresponding to the n segmentation units can be respectively... The input is fed into two cascaded Transformer encoders, each containing a 6-layer neural network structure, and multi-layer bidirectional semantic fusion is performed during the encoding process. Finally, the second Transformer encoder generates initial feature vectors corresponding to n segmentation units. Each initial feature vector contains both local syntactic features and global semantic information of the segmentation unit.
[0031] Step S104: Correct the initial feature vectors corresponding to the multiple segmentation units respectively to obtain the target feature vectors corresponding to the multiple segmentation units respectively;
[0032] It is understandable that by correcting the initial feature vector, the quality of the target feature vector of the obtained segmentation unit can be further improved, thereby improving the accuracy of the target entity recognition result.
[0033] In one optional embodiment, the initial feature vectors corresponding to the multiple segmentation units are modified respectively to obtain the target feature vectors corresponding to the multiple segmentation units, including: based on the initial feature vectors corresponding to the multiple segmentation units, a bidirectional long short-term memory network is used to obtain the first feature vectors corresponding to the multiple segmentation units respectively; based on the first feature vectors corresponding to the multiple segmentation units, a hierarchical attention mechanism is used to obtain the target feature vectors corresponding to the multiple segmentation units respectively.
[0034] It can be understood that, based on the initial feature vectors corresponding to multiple segmentation units, a bidirectional long short-term memory network is used to obtain the first feature vectors corresponding to each segmentation unit. A hierarchical attention mechanism is then used to optimize the first feature vectors corresponding to each segmentation unit, resulting in the target feature vectors corresponding to each segmentation unit. Through this process, the final target feature vectors can better reflect the real context and professional characteristics of the target power dispatch text, thereby improving the accuracy of entity recognition results.
[0035] Optionally, a BiLSTM model can be used to obtain the first feature vectors corresponding to each of the multiple segmentation units. BiLSTM consists of two independent Long Short-Term Memory Networks (LSTMs): a forward LSTM and a backward LSTM. The forward LSTM processes the segmentation units according to their order of appearance in the target power dispatch text. Sequential processing is performed to capture the historical dependencies between segmentation units; the inverse LSTM processes the segmentation units according to their order of appearance in the target power dispatch text. Reverse processing is performed to capture potential future information. Contextual information of the target power dispatch text is captured through a bidirectional long short-term memory network. The final output (i.e., the first feature vector) at each time step (the number of time steps is the same as the number of segmentation units) is formed by concatenating or weighting the bidirectional hidden states (i.e., the forward-order first feature vector obtained by the forward LSTM and the reverse-order first feature vector obtained by the backward LSTM), simultaneously encompassing past and future information and avoiding information omissions in the unidirectional LSTM model. The sequence of first feature vectors formed by the first feature vectors corresponding to multiple segmentation units can be determined as follows:
[0036]
[0037] in, This represents the first eigenvector at time step t. This represents the forward state, i.e., the first eigenvector in the forward order at time step t obtained by the forward LSTM. This represents the backward state, which is the reversed first feature vector obtained at the t-th time step by the inverse LSTM.
[0038] The LSTM model consists of several parts, including the forget gate, input gate, candidate state determination, update state determination, output gate, and hidden state determination, which will be introduced separately below.
[0039] Optionally, the forget gate primarily controls the degree to which the target power dispatch text retains historical memory. The forget gate can be constructed as follows:
[0040]
[0041] in, This represents the forget gate state at time step t (with a value range of [0, 1]), and is mainly used to control how much information is retained in the current time step t. This represents the hidden state output by the LSTM at time step t-1. and This represents the first weight matrix and the first bias vector. Let be the input vector at time step t. For example, it could be the t-th initial feature vector in a sequence of initial feature vectors arranged in ascending order according to the order in which the segmentation units appear in the target power dispatch text, or the t-th initial feature vector in a sequence of initial feature vectors arranged in descending order according to the order in which the segmentation units appear in the target power dispatch text. This represents the Sigmoid activation function.
[0042] Optionally, the input gate is used to control the extent to which new memory is written. The input gate can be constructed as follows:
[0043]
[0044] in, The input gate state at time step t is mainly used to control the new candidate state at time step t. The update ratio, and This represents the second weight matrix and the second bias vector.
[0045] Optionally, a candidate state refers to a candidate value for the generated temporary memory. The candidate state at time step t. The following methods can be used to determine this:
[0046]
[0047] in, and This represents the third weight matrix and the third bias vector.
[0048] Alternatively, the update status can be determined in the following way:
[0049]
[0050] in, This represents the update state at time step t. This represents the update state at time step (t-1). This indicates element-wise multiplication.
[0051] Optionally, the output gate is primarily used to control the output intensity. The output gate can be constructed as follows:
[0052]
[0053] in, This represents the output gate state at time step t. and This represents the fourth weight matrix and the fourth bias vector.
[0054] Alternatively, the hidden state can be determined in the following way:
[0055]
[0056] in, This represents the hyperbolic tangent function, used to update the state at time step t. Compressing to the [-1,1] interval enhances the ability to represent nonlinearities.
[0057] In one optional embodiment, a hierarchical attention mechanism is used to obtain target feature vectors corresponding to multiple segmentation units based on the first feature vectors corresponding to each segmentation unit. This includes: determining position weights for each segmentation unit based on the first feature vectors, where the position weights quantify the importance of the corresponding segmentation unit's position in the target power dispatch text; determining a global semantic vector for the target power dispatch text based on the first feature vectors and position weights, where the global semantic vector describes the contextual dependencies of multiple entities included in the target power dispatch text; obtaining entity-aware weights for each segmentation unit based on the first feature vectors and preset embedding vectors, where the entity-aware weights quantify the importance of the corresponding segmentation unit in the target power dispatch text; and determining target feature vectors for each segmentation unit based on the first feature vectors, position weights, global semantic vector, and entity-aware weights.
[0058] The target feature vectors corresponding to multiple segmentation units are obtained as follows: First, based on the first feature vectors corresponding to each segmentation unit, the positional weights of each segmentation unit are determined. Then, based on the first feature vectors and positional weights of each segmentation unit, a global semantic vector describing the contextual dependencies of multiple entities within the target power dispatching text is determined. Besides positional weights, the semantic importance of entities in the target power dispatching text also needs to be considered. Therefore, a pre-defined embedding vector is assigned to each segmentation unit, encoding information about the entity category to which the segmentation unit belongs. Based on the first feature vectors and pre-defined embedding vectors of each segmentation unit, entity-aware weights are determined. Finally, based on the first feature vectors, positional weights, global semantic vector, and entity-aware weights of each segmentation unit, a feature fusion approach is used to determine the target feature vectors corresponding to each segmentation unit. The determination of the target feature vector is based on the deep fusion of the first feature vector, position weight, global semantic vector and entity perception weight. This process further optimizes the feature representation of the segmentation unit, so that more dimensions of information can be considered when performing entity recognition, thereby improving the comprehensiveness and accuracy of the target entity recognition results.
[0059] Optionally, a hierarchical attention mechanism (HAM) can be used to obtain target feature vectors corresponding to multiple segmentation units. The HAM layer effectively processes long sequence data and improves the accuracy of recognition results by simulating the attention allocation method of humans when reading documents. HAM is an extension of attention mechanisms; its core idea is to apply attention mechanisms at different levels to capture the multi-level structural information of the data more meticulously. Compared with traditional attention mechanisms, HAM can simultaneously focus on local information and global contextual information of the data, making it particularly suitable for processing data with obvious hierarchical structures, such as text (word-sentence-document) and video (frame-segment-video).
[0060] Optionally, HAM, by applying attention at different levels, can simultaneously focus on micro and macro features, reducing information loss and avoiding directly compressing all information into a single representation, thus enhancing the interpretability of the recognition results. In entity recognition tasks, when recognizing entities in long sequences of target power dispatch text, the recognition results of earlier key segmentation units are weakened, affecting the recognition of subsequent entities. By introducing the HAM mechanism, attention is added to the segmentation units, ensuring that key segmentation units are recognized, thus solving the problem of semantic sparsity caused by excessively long target power dispatch text.
[0061] First, calculate the positional attention weights (i.e., positional weights).
[0062]
[0063] in, This represents the position weight at time step t. Represents the activation function of a neural network. This is the trainable fifth weight matrix. The length of the first feature vector sequence is determined by the number of segmentation units. This represents the first eigenvector at the j-th time step.
[0064] Secondly, a global semantic vector is generated.
[0065]
[0066] in, This represents the global semantic vector.
[0067] Then, the entity perception weights are calculated.
[0068]
[0069] in, This represents the entity perception weight at time step t. This represents the trainable sixth weight matrix. This represents the preset embedding vector at time step t.
[0070] Finally, hierarchical feature fusion is performed to obtain the target feature vector.
[0071]
[0072] in, This represents the target feature vector at time step t. This refers to the layer normalization operation in a neural network. This represents a linear transformation matrix.
[0073] The target feature vector sequence formed by the target feature vectors corresponding to the multiple segmentation units obtained after the above process. , It can be represented in the following way:
[0074]
[0075] Step S106: Based on the target feature vectors corresponding to the multiple segmentation units, determine the entity label score vectors corresponding to the multiple segmentation units respectively. The entity label score vector is used to indicate the degree of matching between the corresponding segmentation unit and the preset entity label. The entity is a word in the target power dispatch text, and each entity corresponds to at least one segmentation unit.
[0076] It can be understood that, based on the target feature vectors corresponding to multiple segmentation units, entity label score vectors are determined for each segmentation unit. The dimension of the entity label score vector is the same as the number of preset entity labels, and each element quantifies the degree of matching between the preset entity label corresponding to that element and the segmentation unit corresponding to the entity label score vector. By mapping the target feature vector to the entity label score vector, the matching degree between each segmentation unit and the preset entity label can be evaluated more precisely, addressing the coarseness and uncertainty issues in entity recognition and improving the accuracy of target entity recognition results.
[0077] Step S108: Based on the entity label score vectors corresponding to the multiple segmentation units, determine the target entity label vector of the target power dispatch text, wherein the target entity label vector is composed of the target entity labels corresponding to the multiple segmentation units.
[0078] It can be understood that the dimension of the target entity label vector determined above is the same as the number of multiple segmentation units, where each element represents the target entity label of the corresponding segmentation unit.
[0079] In one optional embodiment, the target entity label vector of the target power dispatch text is determined based on the entity label score vectors corresponding to the multiple segmentation units, including: determining multiple initial entity label vectors based on preset entity labels; filtering the multiple initial entity label vectors based on constraints to obtain multiple filtered entity label vectors; and determining the target entity label vector based on the multiple filtered entity label vectors and the entity label score vectors corresponding to the multiple segmentation units.
[0080] The target entity label vector is determined as follows: First, preset entity labels are arranged and combined to obtain multiple initial entity label vectors. The number of these initial entity label vectors is related to the first number of preset entity labels and the second number of multiple segmentation units. Then, based on constraints, these initial entity label vectors are filtered, removing those that do not meet the constraints, resulting in multiple filtered entity label vectors. Finally, based on the entity label score vectors corresponding to each segmentation unit, the target entity label vector for the target power dispatch text is determined from the multiple filtered entity label vectors. By applying constraints to filter the initial entity label vectors, it ensures that the final target entity label vector conforms to the actual application scenario and domain rules of power dispatch, eliminating logically incoherent or non-compliant entity label combinations, and improving the rationality and reliability of the target entity recognition results.
[0081] Optionally, the above constraints may include, but are not limited to, specific dependencies and logical orders between entity tags, such as the timing association between scheduling instructions and control equipment, and the tight coupling between equipment operation and fault status.
[0082] In an optional embodiment, determining the target entity label vector based on multiple filtered entity label vectors and entity label score vectors corresponding to multiple segmentation units includes: determining the label score and transition score corresponding to each of the multiple filtered entity label vectors based on the multiple filtered entity label vectors and entity label score vectors corresponding to multiple segmentation units, wherein the label score is used to indicate the degree of matching between the corresponding filtered entity label vector and the target power dispatch text, and the transition score is used to indicate the rationality of the transition between adjacent entity labels in the corresponding filtered entity label vector; obtaining the total score corresponding to each of the multiple filtered entity label vectors based on the label score and the transition score corresponding to each of the multiple filtered entity label vectors; and determining the filtered entity label vector corresponding to the maximum total score among the total scores corresponding to the multiple filtered entity label vectors as the target entity label vector.
[0083] It is understandable that, based on multiple selected entity label vectors and entity label score vectors corresponding to multiple segmentation units, the label score and transition score corresponding to each of the multiple selected entity label vectors are determined. The label score and transition score of each selected entity label vector are added together to obtain the total score for each of the multiple selected entity label vectors, and the selected entity label vector with the highest score is determined as the target entity label vector. The introduction of the transition score ensures that specific transformation rules in the power dispatching field are followed during entity recognition, avoiding unreasonable entity label transformations and improving the rationality and reliability of the target entity recognition results.
[0084] Optionally, a CRF model can be used to determine the target entity label vector from multiple selected entity label vectors. Conditional Random Fields (CRF) are a classic graphical model applied to sequence labeling tasks, such as entity recognition. By modeling the dependencies between entity labels in multiple segmented unit sequences, it globally optimizes the target entity recognition results, forcing the output of entity label vectors that conform to the syntax and domain rules of the target power dispatch text, thereby improving the accuracy of the target entity recognition prediction.
[0085] Specifically, the CRF layer learns the transition rules of entity labels (e.g., "B-DEV (device start) must be followed by I-DEV (device intermediate)" and cannot be followed by "B-STAT (state start)"), rejecting illegal label combinations during decoding. Simultaneously, based on the target feature vector output by the HAM layer, it calculates the globally optimal entity label combination for the entire segmentation unit sequence, significantly improving the accuracy of target entity recognition results in target power dispatch text. The CRF layer further refines the results obtained from the HAM layer, utilizing power dispatch rule constraints to ensure the rationality of target entity recognition results, thus resolving entity segmentation errors caused by the complexity of technical terminology combinations and entity label dependencies in target power dispatch text.
[0086] Optionally, the target feature vector output by the HAM layer is... Mapping to the label space, an entity label score vector is generated for each segmentation unit at time step t. The entity label score vector at time step t is... The following methods can be used to determine this:
[0087]
[0088] in, This is a trainable seventh weight matrix. This is the seventh bias vector.
[0089] Optionally, a global probability of entity label vector y is calculated, which combines the label score and transition score of entity label vector y.
[0090]
[0091] in, Indicating in the target feature vector sequence Under the given conditions, the global probability of entity label vector y, entity label vector y, As the normalization factor, This represents the entity label of the t-th segment in the entity label vector y. Indicates from Transferred to The score, This represents the label score of the entity label in the t-th segment of the entity label vector y. This represents the label score of the entity label vector y. The transition score represents the entity label vector y. This represents the total score of the entity label vector y.
[0092] Optionally, the loss function of the CRF model drives the CRF model to learn legitimate label paths by maximizing the global probability of the entity label vectors. This transforms the determination of entity label vectors for segmentation units into a global optimization problem, thereby improving the recognition consistency of long-distance segmentation units (such as fault chains across sentences). The loss function of the CRF model is determined as follows:
[0093]
[0094] in, This represents the loss function of the CRF model, used to measure the deviation between the entity label vector predicted by the CRF model and the true entity label vector of the segmentation unit. These are the actual entity label vectors.
[0095] Optionally, this can be achieved by iterating through a vector set consisting of multiple filter entity label vectors. Given a set of multiple filter entity label vectors, y is formed by combining all possible filter entity label vectors y with label scores and transition scores. In the process, the target entity label vector is determined. . The following methods can be used to determine this:
[0096]
[0097] in, This represents a function that takes the maximum value.
[0098] Step S110: Based on the target entity label vector, determine the target entity recognition result of the target power dispatch text, wherein the target entity recognition result is used to describe the entity categories corresponding to the multiple entities included in the target power dispatch text.
[0099] It is understandable that the target entity recognition results determined based on the target entity label vector can accurately locate and classify various entities in the target power dispatch text, such as equipment, actions, and status, thereby improving the accuracy of the target entity recognition results.
[0100] In one optional embodiment, determining the target entity recognition result of the target power dispatch text based on the target entity label vector includes: identifying a first entity label representing the starting position of the entity from the target entity labels corresponding to the multiple segmentation units respectively; segmenting the target entity label vector based on the first entity label to obtain multiple target entity label sub-vectors, wherein the target entity label sub-vectors correspond one-to-one with the multiple entities; and determining the target entity recognition result based on the multiple target entity label sub-vectors.
[0101] The target entity recognition result of the target power dispatch text is determined as follows: First, the first entity label representing the starting position of the entity is determined from the target entity labels corresponding to the multiple segmentation units included in the target entity label vector, for example, the label "B-". Then, based on the first entity label, the target entity label vector is segmented to obtain multiple target entity label sub-vectors, where each target entity label sub-vector corresponds to one entity. Finally, by decoding the target entity label sub-vectors, the entity categories corresponding to the multiple entities are obtained, and the entity categories corresponding to the multiple entities are integrated into the target entity recognition result of the target power dispatch text. By identifying the first entity label at the starting position of the entity and segmenting the target entity label vector based on the first entity label, the boundaries and types of each entity can be accurately identified, solving the common problems of boundary ambiguity and type uncertainty in entity recognition, and improving the accuracy and reliability of the target entity recognition result.
[0102] Optionally, iterate through the target entity label vector. The system identifies the first entity label, which begins with "B-", indicating the start of an entity. Based on this first entity label, the target entity label vector is divided into multiple target entity label sub-vectors, where each sub-vector corresponds to one entity.
[0103] Through the above steps S102 to S110, the goal of segmenting and processing the target power dispatch text to obtain multiple segmentation units, and combining the entity label score vectors corresponding to the multiple segmentation units, can be achieved to determine the target entity recognition result of the target power dispatch text. This achieves the technical effect of improving the accuracy of the target entity recognition result of the target power dispatch text, and thus solves the technical problem of inaccurate entity recognition results of power dispatch text in related technologies.
[0104] Based on the above embodiments and optional embodiments, this application proposes an implementation method for entity recognition of power dispatch text. This implementation method can be understood as a multi-layer model entity extraction method for power dispatch text, which is used to solve problems such as the ambiguity of professional terms, the complex timing dependence of operation instructions, and the fragmentation of long text entity recognition in the process of entity recognition of target power dispatch text, so as to provide high-precision dispatch decision support for intelligent power dispatch system.
[0105] A multi-layer model-based entity extraction method for power dispatch text first parses the ambiguity of power terms in the target power dispatch text using a BERT pre-trained layer. Then, a Bidirectional Long Short-Term Memory Network (BiLSTM) is used to bidirectionally capture the temporal dependencies between entities in the target power dispatch text. Next, a Hierarchical Attention Mechanism (HAM) is introduced to strengthen the weights of key entities in the target power dispatch text. Finally, power dispatch rule constraints are injected through a Conditional Random Field (CRF) layer, and the target entity recognition results of the target power dispatch text are determined based on a pre-built power dispatch text corpus.
[0106] Figure 2 This is a flowchart of an optional entity recognition method for power dispatch text provided according to an embodiment of this application, such as... Figure 2 As shown, the steps of the multi-layer model entity extraction method for power dispatch text include:
[0107] Step S1: Design of BERT pre-trained language model for target power dispatch text.
[0108] The BERT model is a language representation model that encodes natural language. Through a bidirectional Transformer architecture and masked language mechanism, it can effectively solve the problems of ambiguity and context dependence of power terminology in target power dispatching text, achieving dynamic parsing and accurate understanding of power terminology. The role of the BERT model is to transform the input target power dispatching text into a set of vector representations, namely, initial feature vectors corresponding to multiple segmentation units, where each initial feature vector incorporates global information from the target power dispatching text.
[0109] Figure 3 This is a schematic diagram of an optional BERT pre-trained language model provided according to an embodiment of this application. The working principle of the BERT pre-trained language model is as follows: Figure 3 As shown. First, the target power dispatch text is input and segmented to obtain n segmentation units. These n segmentation units constitute a text sequence. The above n segmentation units are encoded to obtain multi-class feature vectors for each segmentation unit, including semantic feature vectors (Token Embeddings), segment feature vectors (Segment Embeddings), and position feature vectors (Position Embeddings). The semantic feature vectors reflect the semantic information of each segmentation unit; the segment feature vectors distinguish the sentence to which each segmentation unit belongs when the input target power dispatch text contains two sentences (e.g., in a question-and-answer task); and the position feature vectors represent the position of each segmentation unit in the target power dispatch text. Based on the semantic feature vectors, segment feature vectors, and position feature vectors, the fused feature vector of the segmentation unit is obtained. The fused feature vector of the m-th (m=1,2,…,n) segmentation unit is... The following method is used to determine:
[0110]
[0111] in, Let m be the semantic feature vector of the m-th segmentation unit. Let be the segment feature vector of the m-th segmentation unit. Let be the positional feature vector of the m-th segmentation unit.
[0112] The fusion feature vectors corresponding to the n segmentation units are respectively The input is fed into two cascaded Transformer encoders, each containing a 6-layer neural network structure, and multi-layer bidirectional semantic fusion is performed during the encoding process. Finally, the second Transformer encoder generates initial feature vectors corresponding to n segmentation units. Each initial feature vector contains both local syntactic features and global semantic information of the segmentation unit.
[0113] Step S2: Design of a bidirectional long short-term memory (BiLSTM) network layer for the target power dispatch text.
[0114] Figure 4 This is a schematic diagram of an optional BiLSTM model provided according to an embodiment of this application. The working principle of the BiLSTM model is as follows: Figure 4 As shown, BiLSTM consists of two independent Long Short-Term Memory Networks (LSTM): a forward LSTM and a backward LSTM. The forward LSTM processes the segments according to their order of appearance in the target power dispatch text. Sequential processing is performed to capture the historical dependencies between segmentation units; the inverse LSTM processes the segmentation units according to their order of appearance in the target power dispatch text. Reverse processing is performed to capture potential future information. A bidirectional long short-term memory network is used to deeply capture the contextual information of the target power dispatch text. The final output (i.e., the first feature vector) at each time step (the number of time steps is the same as the number of segmentation units) is formed by concatenating or weighting the bidirectional hidden states (i.e., the forward-order first feature vector obtained by the forward LSTM and the reverse-order first feature vector obtained by the backward LSTM), simultaneously encompassing past and future information and avoiding information omissions in the unidirectional LSTM model. The sequence of first feature vectors formed by the first feature vectors corresponding to multiple segmentation units is determined as follows:
[0115]
[0116] in, This represents the first eigenvector at time step t. This represents the forward state, i.e., the first eigenvector in the forward order at time step t obtained by the forward LSTM. This represents the backward state, which is the reversed first feature vector obtained at the t-th time step by the inverse LSTM.
[0117] The LSTM model consists of several parts, including the forget gate, input gate, candidate state determination, update state determination, output gate, and hidden state determination, which will be introduced separately below.
[0118] The forgetting gate primarily controls the degree to which the target power dispatch text retains historical memories. The forgetting gate is constructed as follows:
[0119]
[0120] in, This represents the forget gate state at time step t (with a value range of [0, 1]), and is mainly used to control how much information is retained in the current time step t. This represents the hidden state output by the LSTM at time step t-1. and This represents the first weight matrix and the first bias vector. Let be the input vector at time step t. For example, it could be the t-th initial feature vector in a sequence of initial feature vectors arranged in ascending order according to the order in which the segmentation units appear in the target power dispatch text, or the t-th initial feature vector in a sequence of initial feature vectors arranged in descending order according to the order in which the segmentation units appear in the target power dispatch text. This represents the Sigmoid activation function.
[0121] The input gate controls the degree to which new memory is written. The input gate is constructed as follows:
[0122]
[0123] in, The input gate state at time step t is mainly used to control the new candidate state at time step t. The update ratio, and This represents the second weight matrix and the second bias vector.
[0124] Candidate states refer to the candidate values of the generated temporary memories. The candidate states at time step t are... The following method is used to determine:
[0125]
[0126] in, and This represents the third weight matrix and the third bias vector.
[0127] The update status is determined in the following way:
[0128]
[0129] in, This represents the update state at time step t. This represents the update state at time step (t-1). This indicates element-wise multiplication.
[0130] Output gates are primarily used to control output intensity. Output gates are constructed as follows:
[0131]
[0132] in, This represents the output gate state at time step t. and This represents the fourth weight matrix and the fourth bias vector.
[0133] The hidden state is determined in the following way:
[0134]
[0135] in, This represents the hyperbolic tangent function, used to update the state at time step t. Compressing to the [-1,1] interval enhances the ability to represent nonlinearities.
[0136] Step S3: Design of a hierarchical attention mechanism (HAM) layer for target power dispatch text.
[0137] Hierarchical Attention Mechanism (HAM) effectively processes long sequences of data and improves the accuracy of recognition results by simulating how humans allocate attention when reading documents. HAM is an extension of attention mechanisms; its core idea is to apply attention mechanisms at different levels to capture the multi-layered structural information of the data more meticulously. Compared to traditional attention mechanisms, HAM can simultaneously focus on both local and global contextual information, making it particularly suitable for processing data with a clear hierarchical structure, such as text (word-sentence-document) and video (frame-segment-video).
[0138] HAM (Hypertext Markup Agent) applies attention at different levels, simultaneously focusing on both micro and macro features, reducing information loss, avoiding the direct compression of all information into a single representation, and enhancing the interpretability of the recognition results. In entity recognition tasks, when recognizing entities in long sequences of target power dispatch text, the recognition results of earlier key segmentation units are weakened, affecting the recognition of subsequent entities. By introducing the HAM mechanism, attention is added to the segmentation units, ensuring that key segmentation units are recognized, thus solving the problem of semantic sparsity caused by excessively long target power dispatch text.
[0139] First, calculate the positional attention weights (i.e., positional weights).
[0140]
[0141] in, This represents the position weight at time step t. Represents the activation function of a neural network. This is the trainable fifth weight matrix. The length of the first feature vector sequence is determined by the number of segmentation units. This represents the first eigenvector at the j-th time step.
[0142] Secondly, a global semantic vector is generated.
[0143]
[0144] in, This represents the global semantic vector.
[0145] Then, the entity perception weights are calculated.
[0146]
[0147] in, This represents the entity perception weight at time step t. This represents the trainable sixth weight matrix. This represents the preset embedding vector at time step t.
[0148] Finally, hierarchical feature fusion is performed to obtain the target feature vector.
[0149]
[0150] in, This represents the target feature vector at time step t. This refers to the layer normalization operation in a neural network. This represents a linear transformation matrix.
[0151] The target feature vector sequence formed by the target feature vectors corresponding to the multiple segmentation units obtained after the above process. , It is represented in the following way:
[0152]
[0153] Step S4: Design of the Conditional Random Field (CRF) layer for the target power dispatch text.
[0154] Conditional Random Fields (CRFs) are a classic graphical model applied to sequence labeling tasks, such as entity recognition. By modeling the dependencies between entity labels in multiple segmented sequences, it globally optimizes the target entity recognition results, forcing the output of entity label vectors that conform to the syntax and domain rules of the target power dispatch text, thereby improving the accuracy of target entity recognition predictions.
[0155] Specifically, the CRF layer learns the transition rules of entity labels (e.g., "B-DEV (device start) must be followed by I-DEV (device intermediate)" and cannot be followed by "B-STAT (state start)"), rejecting illegal label combinations during decoding. Simultaneously, based on the target feature vector output by the HAM layer, it calculates the globally optimal entity label combination for the entire segmentation unit sequence, significantly improving the accuracy of target entity recognition results in target power dispatch text. The CRF layer further refines the results obtained from the HAM layer, utilizing power dispatch rule constraints to ensure the rationality of target entity recognition results, thus resolving entity segmentation errors caused by the complexity of technical terminology combinations and entity label dependencies in target power dispatch text.
[0156] The target feature vector output by the HAM layer Mapping to the label space, an entity label score vector is generated for each segmentation unit at time step t. The entity label score vector at time step t is... The following method is used to determine:
[0157]
[0158] in, This is a trainable seventh weight matrix. This is the seventh bias vector.
[0159] Calculate the global probability of the entity label vector y, which combines the label score and transition score of the entity label vector y.
[0160]
[0161] in, Indicating in the target feature vector sequence Under the given conditions, the global probability of entity label vector y, entity label vector y, As the normalization factor, This represents the entity label of the t-th segment in the entity label vector y. Indicates from Transferred to The score, This represents the label score of the entity label in the t-th segment of the entity label vector y. This represents the label score of the entity label vector y. The transition score represents the entity label vector y. This represents the total score of the entity label vector y.
[0162] The loss function of the CRF model drives the model to learn legitimate label paths by maximizing the global probability of the entity label vectors. This transforms the determination of entity label vectors for segmentation units into a global optimization problem, thereby improving the recognition consistency of long-distance segmentation units (such as fault chains across sentences). The loss function of the CRF model is determined as follows:
[0163]
[0164] in, This represents the loss function of the CRF model, used to measure the deviation between the entity label vector predicted by the CRF model and the true entity label vector of the segmentation unit. These are the actual entity label vectors.
[0165] By traversing the vector set composed of multiple filter entity label vectors Given a set of multiple filter entity label vectors, y is formed by combining all possible filter entity label vectors y with label scores and transition scores. In the process, the target entity label vector is determined. . The following method is used to determine:
[0166]
[0167] in, This represents a function that takes the maximum value.
[0168] A complete entity recognition model was established through steps S1-S4 above. The BERT-BiLSTM-HAM-CRF four-layer model formed a deep synergistic advantage in entity recognition of target power dispatch text, comprehensively improving the entity recognition capability of target power dispatch text. The BERT pre-trained model parses the deep semantics of power terms in the target power dispatch text (such as the ambiguity of "differential protection" and "reclosing"). BiLSTM bidirectionally captures the temporal dependencies between entities in the target power dispatch text (such as the sequential logic of "disconnecting the circuit breaker → activating protection"). The HAM attention mechanism strengthens the weight of key entities in the target power dispatch text (such as assigning high weights to "tripping" and "overload"). The CRF layer, by injecting power dispatch rule constraints, outputs entity label vectors that conform to dispatch specifications (such as ensuring that "protection action" is labeled as B-ACT / I-ACT as a whole rather than fragmented labels). This architecture is particularly effective in long-target power dispatch texts. When dealing with complex events, HAM can resist semantic dilution across sentences, while CRF avoids the accidental disassembly of key entities such as "differential protection actions". Ultimately, it achieves complete, accurate, and compliant identification and capture of entities such as dispatching equipment, operation instructions, and fault states, supporting the high reliability requirements of smart grid dispatching decisions.
[0169] Step S5: Construction of the power dispatch text corpus.
[0170] Entity recognition of target power dispatch text requires the establishment of a corpus specifically for power dispatch text to ensure the accuracy, professionalism, and diversity of the BERT-BiLSTM-HAM-CRF four-layer model in the entity extraction process. The specific steps for constructing the corpus are as follows:
[0171] Step S51: Corpus Collection. Primarily targeting power dispatching, this step focuses on the three core dispatching scenarios: dispatch instructions, operation reports, and fault handling, collecting a rich corpus. Table 1 illustrates the sources and content of some of the corpus collected during corpus construction.
[0172] Table 1. Sources and Contents of the Corpus
[0173]
[0174] Step S52: Domain-based adaptive data cleaning, designing corpus cleaning rules. First, standardize label design, for example, using the rule of "substation name + voltage level + equipment type + number" to convert the corpus; second, standardize the time expressions in the corpus, for example, establishing a regular expression library to unify all time formats to HH:MM:SS, and aligning the scheduling terms in the corpus.
[0175] Step S53: Entity Labeling Standardization. A customized BIOTES labeling system is developed for the target power dispatch text. Table 2 shows some entity categories and their corresponding entity labels.
[0176] Table 2 Entity Categories and Corresponding Entity Tags
[0177]
[0178] The above-mentioned multi-layer model entity extraction method for power dispatch text can be applied to a multi-layer model entity extraction system for power dispatch text. The system includes: a BERT pre-training layer, a BiLSTM layer, a HAM layer, a CRF layer, and a power dispatch text corpus, which will be introduced below.
[0179] The BERT pre-trained layer is used to parse and extract features from power terms in the target power dispatch text;
[0180] The BiLSTM layer is used to capture the temporal dependencies between entities in the target power scheduling text;
[0181] The HAM layer is used to implement hierarchical reinforcement of the weights of key entities and to alleviate the semantic sparsity problem.
[0182] The CRF layer is used to inject power dispatch rule constraints and optimize entity label vectors.
[0183] The power dispatch text corpus is used to collect data from core electroplating scenarios such as dispatch instructions / fault reports, perform domain-based adaptive cleaning of the data, standardize the labeling design of the data, standardize the time expressions in the data, and customize the BIOTES tag system.
[0184] The BERT pre-trained layer consists of: text segmentation unit, feature fusion unit, encoding processing unit, and output unit.
[0185] The text segmentation unit is responsible for dividing the input target power dispatch text into basic segmentation units (words or characters) and adding start markers to distinguish sentence boundaries;
[0186] The feature fusion unit extracts semantic feature vectors (token embeddings), segment feature vectors (segment embeddings), and positional feature vectors for each segmentation unit, and generates an initial feature vector by weighted summation to ensure global information fusion.
[0187] The encoding processing unit uses two cascaded Transformer encoders (each containing 6 layers of neural networks) to perform multi-layer bidirectional semantic fusion to solve the problem of polysemy (such as the ambiguity of "differential protection" in different contexts).
[0188] The output unit generates a context-aware sequence of initial feature vectors, each of which contains both local syntactic features and global semantic information, providing a foundation for subsequent processing.
[0189] The BiLSTM layer consists of: forget gate unit, input gate unit, candidate state unit, state update unit, output gate unit, and hidden state unit.
[0190] The forget gate unit controls the degree to which the target power dispatch text retains historical memories (such as previous operation instructions) through the sigmoid function, thus avoiding interference from irrelevant information.
[0191] The input gate unit controls the degree of writing of new memory and filters key semantics (such as the priority of "disconnecting the circuit breaker").
[0192] Candidate state units generate candidate values for temporary memory, capturing potential information at the current time step;
[0193] The state update unit establishes long-distance temporal dependencies by integrating forgotten and newly added information (such as the sequential logic of "disconnect-input" in the operation chain).
[0194] The output gate unit adjusts the intensity of the cell state output through the sigmoid function to ensure that key signals are not diluted;
[0195] The hidden state unit generates the final output feature vector, and the past and future contexts are fused through bidirectional state concatenation to provide high-dimensional discriminative features for entity recognition.
[0196] The HAM layer includes: a positional attention weight calculation unit, a global semantic vector generation unit, an entity perception weight calculation unit, a hierarchical feature fusion unit, and an output sequence unit, focusing on the temporal key information positions in the scheduling text.
[0197] The attention weight calculation unit calculates the positional attention weights using the LeakyReLU activation function;
[0198] The global semantic vector generation unit generates a weighted average global semantic vector to capture the contextual dependencies of the target power dispatch text and avoid semantic dilution.
[0199] The entity perception weight calculation unit combines a preset embedded vector and calculates the entity perception weight through the sigmoid function to enhance the attention to core entities (such as "main transformer protection").
[0200] The hierarchical feature fusion unit integrates the first feature vector, positional attention weights, and entity perception weights through layer normalization to solve the problem of cross-sentence entity fragmentation.
[0201] The output sequence unit generates an enhanced sequence of target feature vectors, providing optimized input for the CRF layer.
[0202] The CRF layer consists of: a label score mapping unit, a sequence conditional probability unit, a loss function unit, and a Viterbi decoding unit.
[0203] The label score mapping unit maps the output of the HAM layer to the label space, generating the entity label score vector for each segmentation unit;
[0204] The sequence conditional probability unit calculates the global probability of the entity label vector and fuses the label score and transition score of the entity label vector;
[0205] The loss function unit drives the CRF model to learn legitimate label paths by maximizing the global probability of the entity label vector, transforming the determination of the entity label vector of the segmentation unit into a global optimization problem, thereby improving the recognition consistency of long-distance segmentation units (such as fault chains across sentences).
[0206] The Viterbi decoding unit uses a dynamic programming CRF model to solve for the optimal target entity label vector and forces the output of compliant entity label vectors.
[0207] The power dispatch text corpus includes: a corpus acquisition unit, a data cleaning unit, and a labeling and standardization unit.
[0208] The corpus collection unit focuses on core scheduling scenarios such as scheduling instructions, operation logs, and fault handling reports (collecting corpora from various sources to ensure the diversity and professionalism of the corpus).
[0209] The data cleaning unit performs domain-based adaptive cleaning of the data, standardizes the labeling design of the corpus, and standardizes the temporal expressions in the corpus.
[0210] The annotation specification unit customizes the BIOTES tag system to annotate entity categories (devices, instructions, status), supporting model training and evaluation.
[0211] The above optional implementation methods achieve at least the following effects: By fusing semantic feature vectors, fragment feature vectors, and positional feature vectors, the initial feature vector can better reflect the real context of the segmentation unit, improving the accuracy of the target entity recognition result; the determination of the target feature vector is based on the deep fusion of the first feature vector, positional weight, global semantic vector, and entity perception weight. This process further optimizes the feature representation of the segmentation unit, enabling more dimensions of information to be considered when performing entity recognition, thus improving the comprehensiveness and accuracy of the target entity recognition result; by mapping the target feature vector to the entity label score vector, the matching degree between each segmentation unit and the preset entity label can be evaluated more precisely, solving the problems of coarseness and uncertainty in entity recognition, and improving the accuracy of the target entity recognition result; the introduction of transfer scores ensures that specific conversion rules in the power dispatching field can be followed when performing entity recognition, avoiding unreasonable entity label conversions and improving the rationality and reliability of the target entity recognition result.
[0212] It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases the steps shown or described may be executed in a different order than that shown here.
[0213] This embodiment also provides an entity recognition device for power dispatch text, which is used to implement the above embodiments and preferred embodiments; details already described will not be repeated. As used below, the terms "module" and "device" can refer to a combination of software and / or hardware that performs a predetermined function. Although the device described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.
[0214] According to an embodiment of this application, an apparatus embodiment for implementing an entity recognition method for power dispatch text is also provided. Figure 5This is a schematic diagram of an entity recognition device for power dispatch text according to an embodiment of this application, such as... Figure 5 As shown, the entity recognition device for the above-mentioned power dispatch text includes a first determining module 502, a target feature vector determining module 504, a second determining module 506, a third determining module 508, and a fourth determining module 510. The device will be described below.
[0215] The first determining module 502 is used to determine the initial feature vectors corresponding to multiple segmentation units based on the target power dispatch text, wherein the multiple segmentation units are obtained by segmenting the target power dispatch text;
[0216] The target feature vector determination module 504 is connected to the first determination module 502 and is used to correct the initial feature vectors corresponding to the multiple segmentation units respectively to obtain the target feature vectors corresponding to the multiple segmentation units respectively.
[0217] The second determining module 506 is connected to the target feature vector determining module 504. It is used to determine the entity label score vector corresponding to the multiple segmentation units based on the target feature vectors corresponding to the multiple segmentation units respectively. The entity label score vector is used to indicate the degree of matching between the corresponding segmentation unit and the preset entity label. The entity is a word in the target power dispatch text. Each entity corresponds to at least one segmentation unit.
[0218] The third determining module 508, connected to the second determining module 506, is used to determine the target entity label vector of the target power dispatch text based on the entity label score vectors corresponding to the multiple segmentation units respectively, wherein the target entity label vector is composed of the target entity labels corresponding to the multiple segmentation units respectively;
[0219] The fourth determining module 510, connected to the third determining module 508, is used to determine the target entity recognition result of the target power dispatch text based on the target entity label vector, wherein the target entity recognition result is used to describe the entity categories corresponding to the multiple entities included in the target power dispatch text.
[0220] This application provides an entity recognition device for power dispatch text. By setting a first determining module 502, a target feature vector determining module 504, a second determining module 506, a third determining module 508, and a fourth determining module 510, the device achieves the purpose of segmenting and processing the target power dispatch text to obtain multiple segmentation units. By combining the entity label score vectors corresponding to the multiple segmentation units, the device determines the target entity recognition result of the target power dispatch text. This improves the accuracy of the target entity recognition result of the target power dispatch text and solves the technical problem of inaccurate entity recognition results of power dispatch text in related technologies.
[0221] It should be noted that the above modules can be implemented by software or hardware. For example, for the latter, it can be implemented in the following ways: the above modules can be located in the same processor; or the above modules can be located in different processors in any combination.
[0222] It should be noted that the first determining module 502, the target feature vector determining module 504, the second determining module 506, the third determining module 508, and the fourth determining module 510 mentioned above correspond to steps S102 to S110 in the embodiments. The instances and application scenarios implemented by the above modules and their corresponding steps are the same, but they are not limited to the content disclosed in the above embodiments. It should be noted that the above modules, as part of the device, can run in a computer terminal.
[0223] It should be noted that the optional or preferred implementation methods of this embodiment can be found in the relevant descriptions in the embodiments, and will not be repeated here.
[0224] The aforementioned entity recognition device for power dispatch text may further include a processor and a memory. The first determining module 502, the target feature vector determining module 504, the second determining module 506, the third determining module 508, the fourth determining module 510, etc., are all stored in the memory as program units. The processor executes the aforementioned program units stored in the memory to realize the corresponding functions.
[0225] The processor contains a core that retrieves the corresponding program unit from memory. One or more cores may be configured. Memory may include non-persistent memory in computer-readable media, random access memory (RAM), and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory includes at least one memory chip.
[0226] This application provides a non-volatile storage medium storing a program that, when executed by a processor, implements an entity recognition method for power dispatch text.
[0227] This application provides an electronic device, including a processor, a memory, and a program stored in the memory and executable on the processor. When the processor executes the program, it performs the following steps: Based on target power dispatch text, it determines initial feature vectors corresponding to multiple segmentation units, wherein the multiple segmentation units are obtained by segmenting the target power dispatch text; it corrects the initial feature vectors corresponding to the multiple segmentation units to obtain target feature vectors corresponding to the multiple segmentation units; based on the target feature vectors corresponding to the multiple segmentation units, it determines entity label score vectors corresponding to the multiple segmentation units, wherein the entity label score vectors indicate the degree of matching between the corresponding segmentation unit and preset entity labels, where entities are words in the target power dispatch text, and each entity corresponds to at least one segmentation unit; based on the entity label score vectors corresponding to the multiple segmentation units, it determines target entity label vectors for the target power dispatch text, wherein the target entity label vectors are composed of target entity labels corresponding to the multiple segmentation units; based on the target entity label vectors, it determines the target entity recognition result for the target power dispatch text, wherein the target entity recognition result describes the entity categories corresponding to the multiple entities included in the target power dispatch text. The device in this document can be a server, PC, etc.
[0228] This application also provides a computer program product, which, when executed on a data processing device, is suitable for executing an initialization program with the following method steps: Based on the target power dispatch text, determining initial feature vectors corresponding to multiple segmentation units, wherein the multiple segmentation units are obtained by segmenting the target power dispatch text; correcting the initial feature vectors corresponding to the multiple segmentation units respectively to obtain target feature vectors corresponding to the multiple segmentation units; based on the target feature vectors corresponding to the multiple segmentation units respectively, determining entity label score vectors corresponding to the multiple segmentation units respectively, wherein the entity label score vectors are used to indicate the degree of matching between the corresponding segmentation unit and preset entity labels, where the entity is a word in the target power dispatch text, and each entity corresponds to at least one segmentation unit; based on the entity label score vectors corresponding to the multiple segmentation units respectively, determining the target entity label vector of the target power dispatch text, wherein the target entity label vector is composed of target entity labels corresponding to the multiple segmentation units respectively; based on the target entity label vectors, determining the target entity recognition result of the target power dispatch text, wherein the target entity recognition result is used to describe the entity categories corresponding to the multiple entities included in the target power dispatch text.
[0229] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0230] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0231] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0232] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0233] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0234] Memory may include non-persistent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.
[0235] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.
[0236] It should also be noted that 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 process, method, article, or apparatus. Unless otherwise specified, 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 that element.
[0237] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0238] The above are merely embodiments of this application and are not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of the claims of this application.
Claims
1. A method for entity recognition in power dispatch text, characterized in that, include: Based on the target power dispatch text, initial feature vectors corresponding to multiple segmentation units are determined, wherein the multiple segmentation units are obtained by segmenting the target power dispatch text; The initial feature vectors corresponding to the plurality of segmentation units are modified respectively to obtain the target feature vectors corresponding to the plurality of segmentation units respectively; Based on the target feature vectors corresponding to the multiple segmentation units, the entity label score vectors corresponding to the multiple segmentation units are determined. The entity label score vectors are used to indicate the degree of matching between the corresponding segmentation unit and the preset entity label. The entity is a word in the target power dispatch text, and each entity corresponds to at least one segmentation unit. Based on the entity label score vectors corresponding to the plurality of segmentation units, the target entity label vector of the target power dispatch text is determined, wherein the target entity label vector is composed of the target entity labels corresponding to the plurality of segmentation units. Based on the target entity label vector, the target entity identification result of the target power dispatch text is determined, wherein the target entity identification result is used to describe the entity categories corresponding to the multiple entities included in the target power dispatch text.
2. The method according to claim 1, characterized in that, The process of determining initial feature vectors corresponding to multiple segmentation units based on the target power dispatch text includes: Encode each segmentation unit to obtain a feature vector set corresponding to each segmentation unit, wherein the feature vector set includes the semantic feature vector, fragment feature vector, and position feature vector of the corresponding segmentation unit; For any segmentation unit among the multiple segmentation units, the semantic feature vector, fragment feature vector and position feature vector of the any segmentation unit are fused to obtain the fused feature vector of the any segmentation unit; The spliced feature vector of any given segment is modified to obtain the initial feature vector of any given segment; The initial feature vectors corresponding to the multiple segmentation units are determined by determining the initial feature vector of any segmentation unit.
3. The method according to claim 1, characterized in that, The step of correcting the initial feature vectors corresponding to the plurality of segmentation units respectively to obtain the target feature vectors corresponding to the plurality of segmentation units includes: Based on the initial feature vectors corresponding to the multiple segmentation units, a bidirectional long short-term memory network is used to obtain the first feature vectors corresponding to the multiple segmentation units. Based on the first feature vectors corresponding to the multiple segmentation units, a hierarchical attention mechanism is used to obtain the target feature vectors corresponding to the multiple segmentation units.
4. The method according to claim 3, characterized in that, The step of obtaining the target feature vectors corresponding to the multiple segmentation units by employing a hierarchical attention mechanism based on the first feature vectors corresponding to the multiple segmentation units includes: Based on the first feature vectors corresponding to the plurality of segmentation units, the position weights corresponding to the plurality of segmentation units are determined, wherein the position weights are used to quantify the importance of the position of the corresponding segmentation unit in the target power dispatch text; Based on the first feature vectors corresponding to the plurality of segmentation units and the position weights corresponding to the plurality of segmentation units, the global semantic vector of the target power dispatch text is determined, wherein the global semantic vector is used to describe the context dependency relationship of the plurality of entities included in the target power dispatch text; Based on the first feature vectors corresponding to the multiple segmentation units and the preset embedding vectors corresponding to the multiple segmentation units, entity perception weights corresponding to the multiple segmentation units are obtained. The entity perception weights are used to quantify the importance of the corresponding segmentation units in the target power dispatch text. Based on the first feature vectors corresponding to the plurality of segmentation units, the position weights corresponding to the plurality of segmentation units, the global semantic vector, and the entity perception weights corresponding to the plurality of segmentation units, the target feature vectors corresponding to the plurality of segmentation units are determined.
5. The method according to any one of claims 1 to 4, characterized in that, The step of determining the target entity label vector of the target power dispatch text based on the entity label score vectors corresponding to the multiple segmentation units includes: Based on the preset entity labels, multiple initial entity label vectors are determined; Based on the constraints, the multiple initial entity label vectors are filtered to obtain multiple filtered entity label vectors; The target entity label vector is determined based on the plurality of filtered entity label vectors and the entity label score vectors corresponding to the plurality of segmentation units.
6. The method according to claim 5, characterized in that, The step of determining the target entity label vector based on the plurality of filtered entity label vectors and the entity label score vectors corresponding to the plurality of segmentation units includes: Based on the plurality of filtered entity label vectors and the entity label score vectors corresponding to the plurality of segmentation units respectively, the label scores corresponding to the plurality of filtered entity label vectors and the transition scores corresponding to the plurality of filtered entity label vectors are determined respectively. The label scores are used to indicate the degree of matching between the corresponding filtered entity label vector and the target power dispatch text, and the transition scores are used to indicate the degree of rationality of the conversion of adjacent entity labels in the corresponding filtered entity label vector. Based on the tag scores corresponding to the multiple filtering entity tag vectors and the transition scores corresponding to the multiple filtering entity tag vectors, the total scores corresponding to the multiple filtering entity tag vectors are obtained. The filter entity label vector corresponding to the maximum total score among the multiple filter entity label vectors is determined as the target entity label vector.
7. The method according to claim 1, characterized in that, The determination of the target entity recognition result of the target power dispatch text based on the target entity label vector includes: Identify the first entity label representing the starting position of the entity from the target entity labels corresponding to the multiple segmentation units; Based on the first entity label, the target entity label vector is segmented to obtain multiple target entity label sub-vectors, wherein each target entity label sub-vector corresponds one-to-one with the multiple entities; The target entity recognition result is determined based on the multiple target entity label sub-vectors.
8. An entity recognition device for power dispatch text, characterized in that, include: The first determining module is used to determine the initial feature vectors corresponding to multiple segmentation units based on the target power dispatch text, wherein the multiple segmentation units are obtained by segmenting the target power dispatch text; The target feature vector determination module is used to correct the initial feature vectors corresponding to the plurality of segmentation units respectively, so as to obtain the target feature vectors corresponding to the plurality of segmentation units respectively; The second determining module is used to determine the entity label score vector corresponding to each of the multiple segmentation units based on the target feature vectors corresponding to the multiple segmentation units respectively. The entity label score vector is used to indicate the degree of matching between the corresponding segmentation unit and the preset entity label. The entity is a word in the target power dispatch text, and each entity corresponds to at least one segmentation unit. The third determining module is used to determine the target entity label vector of the target power dispatch text based on the entity label score vectors corresponding to the plurality of segmentation units respectively, wherein the target entity label vector is composed of the target entity labels corresponding to the plurality of segmentation units respectively; The fourth determining module is used to determine the target entity recognition result of the target power dispatch text based on the target entity label vector, wherein the target entity recognition result is used to describe the entity categories corresponding to the multiple entities included in the target power dispatch text.
9. A non-volatile storage medium, characterized in that, The non-volatile storage medium stores multiple instructions, which are adapted to be loaded by a processor and executed by the entity recognition method for power dispatch text as described in any one of claims 1 to 7.
10. An electronic device, characterized in that, include: One or more processors and a memory, the memory being used to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors cause the one or more processors to implement the entity recognition method for power dispatch text as described in any one of claims 1 to 7.