Text entity recognition method and device in power dispatching field, equipment and storage medium

By constructing a template for entity recognition in the field of power dispatching and a boundary adjustment strategy, the problem of inaccurate text entity recognition in the field of power dispatching was solved, and more accurate entity text fragment recognition was achieved.

CN120996041APending Publication Date: 2025-11-21ELECTRIC POWER RES INST CHINA SOUTHERN POWER GRID CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511012232.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-22
Publication Date
2025-11-21

AI Technical Summary

Technical Problem

Existing text entity recognition methods in the field of power dispatching are not accurate enough.

Method used

A template for entity recognition in the field of power dispatching is constructed. Entity location information is predicted using a machine reading comprehension model. Boundary adjustments are made by combining syntactic and semantic rules, and the boundary location combination information with the highest confidence is selected to achieve accurate entity text fragment recognition.

Benefits of technology

It improves the accuracy of text entity recognition in the field of power dispatching, ensuring more accurate recognition results for entity text fragments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120996041A_ABST
    Figure CN120996041A_ABST
Patent Text Reader

Abstract

The invention relates to a text entity recognition method and device in the field of power dispatching, equipment and a storage medium. The method comprises the steps of obtaining a to-be-recognized text and an entity recognition problem template of the to-be-recognized text in the field of power dispatching; according to the entity recognition problem template, entity position information prediction is conducted on the to-be-recognized text, boundary position combination information of multiple entities in the to-be-recognized text is obtained, and each piece of boundary position combination information comprises starting position information and ending position information; performing boundary adjustment on the initial position information and the end position information in each piece of boundary position combination information to obtain target boundary position combination information of the plurality of entities; according to the multiple pieces of target boundary position combination information, entity text fragments of multiple entities in the text to be recognized are detected, and entity recognition results of the multiple entity text fragments are detected. By adopting the method, entity recognition of texts in the field of power dispatching can be accurately performed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of entity recognition technology, and in particular to a method, apparatus, device and storage medium for entity recognition of text in the field of power dispatching. Background Technology

[0002] Entity recognition is one of the core tasks in natural language processing, referring to the automatic identification and labeling of entities with specific meanings from unstructured text, and the classification of these entities into predefined entity types. Therefore, entity recognition in text is particularly important in the field of power dispatching.

[0003] In traditional technologies, large language models, with their powerful contextual understanding capabilities and knowledge reserves, are able to identify entities such as names, organizations, locations, times, and technical terms in texts with zero or few samples, and classify and categorize them, thereby enabling computer systems to understand key information elements in texts. Therefore, large pre-trained language models are generally used to identify and extract specific types of entities from unstructured texts.

[0004] However, current methods for entity recognition in text within the field of power dispatching suffer from inaccuracies. Summary of the Invention

[0005] Therefore, it is necessary to provide an accurate method, apparatus, computer equipment, computer-readable storage medium, and computer program product for entity recognition of text in the field of power dispatching, addressing the aforementioned technical problems.

[0006] Firstly, this application provides a method for entity recognition of text in the field of power dispatching, including:

[0007] To obtain templates for entity recognition problems of text to be recognized in the field of power dispatching;

[0008] Based on the entity recognition problem template, entity location information is predicted in the text to be recognized, and the boundary location combination information of multiple entities in the text to be recognized is obtained. Each boundary location combination information includes start location information and end location information.

[0009] The starting and ending position information in each boundary position combination information are adjusted to obtain the target boundary position combination information of multiple entities.

[0010] Based on the combination of multiple target boundary position information, the entity text fragments of multiple entities in the text to be identified are detected, and the entity recognition results of the multiple entity text fragments are detected.

[0011] In one embodiment, based on the entity recognition problem template, entity location information is predicted in the text to be recognized to obtain the boundary location combination information of multiple entities in the text to be recognized, including:

[0012] The text to be recognized is concatenated with an entity recognition question template, and the concatenated information is encoded to obtain the contextual representation information of the text to be recognized.

[0013] Entity location information is predicted from contextual representation information to obtain multiple candidate boundary location combinations for each entity in the text to be identified.

[0014] For each entity, the first confidence evaluation result of multiple candidate boundary location combinations is detected, and the boundary location combination with the highest first confidence evaluation result is selected from the multiple candidate boundary location combinations.

[0015] In one embodiment, the start and end position information in each boundary position combination information are adjusted to obtain target boundary position combination information for multiple entities, including:

[0016] For each entity, obtain the adjustment range corresponding to the combination of the entity's boundary positions;

[0017] Based on the pre-acquired adjustment range, the starting position information and ending position information in the boundary position combination information are adjusted to obtain multiple adjusted boundary position combination information. Each adjusted boundary position combination information includes updated starting position information and updated ending position information.

[0018] Detect the second confidence assessment result corresponding to each adjusted combination of boundary position information;

[0019] From multiple adjusted boundary location combinations, the boundary location combination with the highest second confidence level is selected as the target boundary location combination for the entity.

[0020] In one embodiment, obtaining the adjustment range corresponding to the boundary position combination information of the entity includes:

[0021] Obtain the initial predicted entity type, the first confidence assessment result, and the text complexity of the text to be identified for each combination of boundary position information of the entity.

[0022] Based on text complexity, initial predicted entity type, and first confidence assessment results, detect the boundary constraint strength information of boundary location combination information;

[0023] Based on the boundary constraint strength information, detect the adjustment range corresponding to the boundary position combination information.

[0024] In one embodiment, the method further includes:

[0025] Obtain the entity type recognition problem template and the actual entity type of the entity text fragment;

[0026] Based on the entity type recognition problem template, entity type recognition is performed on the entity text fragment to obtain the predicted entity type of the entity text fragment;

[0027] The first accuracy assessment result of the combined information of the target boundary location is based on the actual entity type and the predicted entity type.

[0028] By calculating the similarity and judging the consistency of boundary lengths among multiple text fragments of the same entity in the text to be identified, a second accuracy evaluation result of the target boundary position combination information is obtained;

[0029] Based on the first accuracy assessment result and the second accuracy assessment result, determine whether the target boundary position combination information is valid.

[0030] In one embodiment, based on a combination of multiple target boundary position information, entity text fragments of multiple entities in the text to be identified are detected, and entity recognition results of the multiple entity text fragments are detected, including:

[0031] Obtain the general instruction prefix information, task instruction information, and output format information corresponding to the text to be recognized;

[0032] Based on the combination of multiple target boundary position information, the boundary constraint information of the text to be identified is detected;

[0033] Based on boundary constraint information, the text to be recognized, general instruction prefix information, task instruction information, and output format information, a boundary prompt template for the text to be recognized is constructed.

[0034] Based on the boundary cue template, detect entity text fragments of multiple entities in the text to be identified, as well as the predicted entity type and predicted entity attributes of each entity text fragment.

[0035] In one embodiment, after detecting the entity recognition results of multiple entity text fragments, the method further includes:

[0036] Based on the entity recognition results of multiple entity text fragments, detect the number of valid entities that can be identified in the multiple entity recognition results;

[0037] Based on the quantitative information, the boundary compliance rate of the entity recognition results is measured;

[0038] Based on the boundary compliance rate, the accuracy of the recognition results of multiple entities under the boundary constraints of combined information at multiple target boundary locations is evaluated.

[0039] Secondly, this application also provides a text entity recognition device in the field of power dispatching, comprising:

[0040] The data acquisition module is used to acquire the text to be identified and the entity recognition problem template of the text to be identified in the field of power dispatching;

[0041] The boundary prediction module is used to predict the entity location information of the text to be identified based on the entity recognition problem template, and obtain the boundary location combination information of multiple entities in the text to be identified. Each boundary location combination information includes start position information and end position information.

[0042] The boundary adjustment module is used to adjust the start and end position information in each boundary position combination information to obtain the target boundary position combination information of multiple entities.

[0043] The entity recognition module is used to detect entity text fragments of multiple entities in the text to be recognized based on the combination information of multiple target boundary positions, and to detect the entity recognition results of multiple entity text fragments.

[0044] Thirdly, this application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to perform the following steps:

[0045] To obtain templates for entity recognition problems of text to be recognized in the field of power dispatching;

[0046] Based on the entity recognition problem template, entity location information is predicted in the text to be recognized, and the boundary location combination information of multiple entities in the text to be recognized is obtained. Each boundary location combination information includes start location information and end location information.

[0047] The starting and ending position information in each boundary position combination information are adjusted to obtain the target boundary position combination information of multiple entities.

[0048] Based on the combination of multiple target boundary position information, the entity text fragments of multiple entities in the text to be identified are detected, and the entity recognition results of the multiple entity text fragments are detected.

[0049] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, performs the following steps:

[0050] To obtain templates for entity recognition problems of text to be recognized in the field of power dispatching;

[0051] Based on the entity recognition problem template, entity location information is predicted in the text to be recognized, and the boundary location combination information of multiple entities in the text to be recognized is obtained. Each boundary location combination information includes start location information and end location information.

[0052] The starting and ending position information in each boundary position combination information are adjusted to obtain the target boundary position combination information of multiple entities.

[0053] Based on the combination of multiple target boundary position information, the entity text fragments of multiple entities in the text to be identified are detected, and the entity recognition results of the multiple entity text fragments are detected.

[0054] Fifthly, this application also provides a computer program product, including a computer program that, when executed by a processor, performs the following steps:

[0055] To obtain templates for entity recognition problems of text to be recognized in the field of power dispatching;

[0056] Based on the entity recognition problem template, entity location information is predicted in the text to be recognized, and the boundary location combination information of multiple entities in the text to be recognized is obtained. Each boundary location combination information includes start location information and end location information.

[0057] The starting and ending position information in each boundary position combination information are adjusted to obtain the target boundary position combination information of multiple entities.

[0058] Based on the combination of multiple target boundary position information, the entity text fragments of multiple entities in the text to be identified are detected, and the entity recognition results of the multiple entity text fragments are detected.

[0059] The aforementioned methods, devices, computer equipment, computer-readable storage media, and computer program products for entity recognition of text in the power dispatching field construct an entity recognition problem template for the text to be recognized in the power dispatching field. By accurately predicting the entity location information of the text to be recognized, the boundary location combination information of multiple entities in the text to be recognized can be obtained. Furthermore, the boundary location information can be adjusted to obtain optimized target boundary location combination information of multiple entities. Finally, based on the multiple target boundary location combination information, the entity text fragments of multiple entities in the text to be recognized are accurately determined. Since the entity text fragments are obtained based on accurate target boundary location combination information, the entity recognition results of multiple entity text fragments are also more accurate. Attached Figure Description

[0060] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the drawings used in the description of the embodiments of this application or related technologies will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0061] Figure 1 This is an application environment diagram of a text entity recognition method in the field of power dispatching, as shown in one embodiment.

[0062] Figure 2 This is a flowchart illustrating a text entity recognition method in the field of power dispatching, as shown in one embodiment.

[0063] Figure 3 This is a flowchart illustrating a text entity recognition method in the field of power dispatching, as shown in another embodiment.

[0064] Figure 4 This is a structural block diagram of a text entity recognition device in the field of power dispatching, as shown in one embodiment.

[0065] Figure 5 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation

[0066] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are for illustrative purposes only and are not intended to limit the scope of this application.

[0067] The entity recognition method for text in the field of power dispatching provided in this application can be applied to, for example... Figure 1 In the application environment shown, terminal 102 communicates with server 104 via a network. A data storage system can store the data that server 104 needs to process. The data storage system can be integrated onto server 104, or it can be located in the cloud or on another network server.

[0068] The user inputs or imports text to be recognized on the entity recognition interface of terminal 102 and triggers the entity recognition control. Terminal 102 responds to the trigger operation of the entity recognition control, generates an entity recognition request based on the acquired text to be recognized in the power dispatching field, and sends the entity recognition request to server 104. Server 104 obtains the text to be recognized carried in the entity recognition request and imports the entity recognition question template of the text to be recognized from the database. According to the entity recognition question template, it predicts the entity position information of the text to be recognized, and obtains the boundary position combination information of multiple entities in the text to be recognized. Each boundary position combination information includes start position information and end position information. The boundary is adjusted on the start position information and end position information in each boundary position combination information to obtain the target boundary position combination information of multiple entities. According to the multiple target boundary position combination information, entity text fragments of multiple entities in the text to be recognized are detected, and the entity recognition results of multiple entity text fragments are detected. Furthermore, the entity recognition results of the entity text fragments can also be pushed to terminal 102 and displayed to the user by terminal 102.

[0069] The terminal 102 can be, but is not limited to, various personal computers, laptops, smartphones, tablets, IoT devices, and portable wearable devices. IoT devices can include smart speakers, smart TVs, smart air conditioners, smart in-vehicle systems, and projection devices. Portable wearable devices can include smartwatches, smart bracelets, and head-mounted displays. Head-mounted displays can be virtual reality (VR) devices, augmented reality (AR) devices, and smart glasses. The server 104 can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services.

[0070] In one exemplary embodiment, such as Figure 2 As shown, a method for entity recognition of text in the field of power dispatching is provided, which can be applied to... Figure 1 Let's take server 104 as an example for explanation. Specifically:

[0071] S100: Obtain templates for entity recognition problems of text to be recognized and text to be recognized in the field of power dispatching.

[0072] The text in this application mainly targets text in the field of power dispatching. In particular, the entity recognition question template is a general question template. For example, the following general templates may be used for different entity types: Equipment entity: "Which power equipment is mentioned in the text?"; Operation entity: "What operation behaviors are described in the text?"; Location entity: "What locations or positions are mentioned in the text?"; Time entity: "What time information is mentioned in the text?", etc.

[0073] Specifically, to achieve entity recognition in text to be identified in the field of power dispatching, it is first necessary to construct an entity recognition question template. Based on the entity recognition question template and the text to be identified, the entities in the text can be identified together. The entity recognition question template can be stored in a database; when a user selects text to be identified, the entity recognition question template is retrieved from the database.

[0074] S200, based on the entity recognition problem template, predict the entity location information of the text to be recognized, and obtain the boundary location combination information of multiple entities in the text to be recognized, wherein each boundary location combination information includes start location information and end location information.

[0075] Specifically, based on the entity recognition problem template, entity position information is predicted by analyzing the start and end position information of the text to be recognized. This can accurately identify all possible start and end position information corresponding to each entity in the text to be recognized, and determine the final start and end position information of each entity from all possible suspected start and end position information. The final start and end position information of each entity is then used as the boundary position combination information of that entity.

[0076] Furthermore, when finding all possible start and end position information for each entity, this application can also obtain the probability distribution information corresponding to each start position information and the probability distribution information corresponding to each end position information.

[0077] In practical applications, based on entity recognition question templates, predicting entity location information in the text to be recognized can often be achieved using an MRC (Machine Reading Comprehension) model. This model aims to enable machines to understand text content like humans and answer related questions based on the text.

[0078] S300, perform boundary adjustment on the start and end position information in each boundary position combination information to obtain target boundary position combination information for multiple entities.

[0079] Specifically, to further improve the accuracy of boundary recognition, the starting and ending position information in each boundary position combination information can be adjusted. That is, by referring to the syntax and semantic rules of the text to be recognized, the adjustment range corresponding to each boundary position combination information is obtained, and the starting and ending position information in the corresponding boundary position combination information is adjusted according to the adjustment range to obtain the target boundary position combination information of multiple entities. For example, partially recognized personal names can be expanded into full names, or organization names containing redundant modifiers can be reduced to core names.

[0080] S400, based on the combination information of multiple target boundary positions, detects entity text fragments of multiple entities in the text to be identified, and detects the entity recognition results of multiple entity text fragments.

[0081] Specifically, the target boundary position combination information is used as a structured constraint to guide the large language model to extract entities within the boundary range corresponding to the predefined target boundary position combination information, thereby achieving synergistic optimization of boundary accuracy and semantic richness.

[0082] In other words, based on the combination information of the target boundary positions of multiple entities, the entity text fragments corresponding to the combination information of the target boundary positions of multiple entities are determined from the text to be identified, and the large language model is used to perform entity recognition on the multiple entity text fragments to obtain the predicted entity type and predicted entity attributes of the multiple entity text fragments.

[0083] In the aforementioned entity recognition method for text in the field of power dispatching, by constructing an entity recognition problem template for the text to be recognized, accurate prediction of entity location information of the text to be recognized can be performed, thereby obtaining the boundary location combination information of multiple entities in the text to be recognized. Furthermore, the boundary location information can be adjusted to obtain optimized target boundary location combination information of multiple entities. Finally, based on the multiple target boundary location combination information, the entity text fragments of multiple entities in the text to be recognized are accurately determined. Since the entity text fragments are obtained based on accurate target boundary location combination information, the entity recognition results of multiple entity text fragments are also more accurate.

[0084] In an exemplary embodiment, based on an entity recognition problem template, entity location information is predicted in the text to be recognized to obtain boundary location combination information of multiple entities in the text to be recognized, including:

[0085] The text to be identified is concatenated with an entity recognition problem template, and the concatenated information is encoded to obtain the contextual representation information of the text to be identified. Entity location information is predicted from the contextual representation information to obtain multiple candidate boundary location combinations for each entity in the text to be identified. For each entity, the first confidence evaluation result of the multiple candidate boundary location combinations is detected, and the boundary location combination with the highest first confidence evaluation result is selected from the multiple candidate boundary location combinations.

[0086] Among them, contextual representation information refers to the semantic encoding of the context surrounding the target words (or fragments) in the text by the model in natural language processing. It is used to capture the ambiguity resolution, semantic association and logical dependence of words in a specific context. Its essence is to transform the linear text sequence into a high-dimensional vector containing contextual semantics, so as to provide a semantic basis for subsequent tasks (such as entity recognition).

[0087] Specifically, based on the entity recognition problem template, the boundary recognition model is used to predict the entity location information of the text to be recognized. The boundary recognition model adopts an encoder-decoder architecture, where the encoder is responsible for text representation learning and the decoder is responsible for boundary prediction.

[0088] In terms of the encoder, a pre-trained language model is used as the foundation, and a self-attention mechanism is employed to capture the correlation information between the question and the text. Specifically, the text X to be recognized is concatenated with the entity recognition question template Q, and the concatenated information is encoded to obtain the contextual representation information of the text to be recognized. The specific process can be represented as follows:

[0089]

[0090] in, This indicates the concatenation of the text to be recognized and the entity recognition question template. It is the contextual representation information of the output text to be recognized. is the length of the entity recognition problem template, n is the length of the text to be recognized, and d is the dimension of the encoder's hidden layer.

[0091] In terms of the decoder, two independent feedforward networks are used to predict entity location information from the context representation information, so as to obtain the start and end position information corresponding to each combination of multiple boundary positions in the text to be recognized. The expressions include: , .

[0092] in, These are the parameter vectors that the decoder can learn during training, used to capture the semantic features of the start and end of the answer. These represent the first probability distribution information of the starting position and the second probability distribution information of multiple ending positions, respectively. Softmax is a normalization function that transforms the input into a probability distribution within the interval [0, 1] with a sum of 1. In other words, S and E are probability information, specifically calculating the probability of using any position as the starting or ending position. For example, for position 1, S = 40%, meaning the probability of using position 1 as the starting position is 40%. The positional information in the text to be recognized can be sorted from left to right or from right to left using numbers, letters, or other sorting symbols; this is not limited here.

[0093] Specifically, using the learnable parameter W s W e The contextual representation information H of the text to be recognized is transformed and then passed through the Softmax function to obtain probability distribution information S and E. Further, the probability distribution information is used to determine multiple candidate boundary position combinations for each entity in the text to be recognized. Each candidate boundary position combination consists of a candidate start position, a candidate end position, a first probability information for the candidate start position, and a second probability information for the candidate end position.

[0094] Furthermore, the boundary position combination information is filtered out from multiple candidate boundary position combination information. Specifically, this can be achieved by detecting the first confidence evaluation result of each of the multiple candidate boundary position combination information. That is, for each candidate boundary position combination information, the first confidence evaluation result of the candidate boundary position combination information is detected. The boundary position combination information with the highest first confidence evaluation result is filtered out from multiple candidate boundary position combination information of the same entity, and the boundary position combination information with the highest first confidence evaluation result is taken as the boundary position combination information of the entity.

[0095] In the above embodiments, by using an encoder to splice and encode the text to be recognized and the entity recognition problem template, the contextual representation information of the text to be recognized can be accurately obtained. Then, based on the accurate contextual representation information of the text to be recognized, the combination information of multiple boundary positions in the text to be recognized can be predicted.

[0096] In an exemplary embodiment, each candidate boundary position combination information further includes first probability information of candidate start position information and second probability information of candidate end position information. Detecting the first confidence evaluation result of the candidate boundary position combination information includes:

[0097] Based on the first probability information and the second probability information of each boundary location combination information, the first confidence evaluation result of multiple boundary location combination information is detected.

[0098] Specifically, each boundary position combination information also includes a first probability distribution information of the starting position and a second probability distribution information of the ending position. The first probability information of each starting position information is determined from the first probability distribution information, and the second probability information of each ending position information is determined from the second probability distribution information.

[0099] The first probability information and the second probability information of each boundary location combination are multiplied to obtain the first confidence assessment result of multiple boundary location combination information, and its expression is as follows:

[0100]

[0101] The first confidence level assessment result is p. i , For the starting position information s i The first probability information, End location information The second probability information.

[0102] The first confidence level assessment result is used to characterize the credibility of the boundary location combination information. Therefore, each boundary location combination information needs to satisfy the requirement that the first confidence level assessment result is greater than the preset first confidence level assessment threshold. ,Right now .

[0103] Furthermore, for each problem The model predicts the K most likely combinations of boundary locations. It is not only necessary to satisfy the requirement that the first confidence level assessment result is greater than the preset first confidence level assessment threshold. It also needs to meet the following requirements: 1. 2. ,in, It is the preset maximum entity length, l q is the length of the entity recognition problem template, and n is the length of the text to be recognized.

[0104] Subsequently, based on the first confidence assessment results of multiple boundary location combination information, the boundary location combination information with the highest first confidence assessment result can be selected from multiple candidate boundary location combination information of the same entity.

[0105] In the above embodiments, the first confidence evaluation result of multiple boundary position combination information can be detected by using the first probability information and the second probability information of each boundary position combination information. Then, the boundary position combination information with the highest first confidence evaluation result can be selected from multiple candidate boundary position combination information of the same entity.

[0106] In an exemplary embodiment, boundary adjustment is performed on the start and end position information in each boundary position combination information to obtain target boundary position combination information for multiple entities, including:

[0107] For each entity, the adjustment range corresponding to the entity's boundary position combination information is obtained; based on the pre-obtained adjustment range, the start position information and end position information in the boundary position combination information are adjusted to obtain multiple adjusted boundary position combination information, wherein each adjusted boundary position combination information includes updated start position information and updated end position information; the second confidence evaluation result corresponding to each adjusted boundary position combination information is detected; from the multiple adjusted boundary position combination information, the boundary position combination information with the highest second confidence evaluation result is selected as the target boundary position combination information of the entity.

[0108] Specifically, in order to further improve the accuracy of boundary recognition, this application designs a number of boundary optimization strategies, one of which is boundary expansion and contraction. That is, according to syntactic and semantic rules, the boundary of the initial recognition is appropriately adjusted. For example, partially recognized personal names are expanded into full names, or organization names containing redundant modifiers are reduced to core names, etc.

[0109] Furthermore, this application obtains the adjustment range corresponding to the boundary position combination information of each entity; based on the adjustment range corresponding to each boundary position combination information, the starting position information and ending position information in the corresponding boundary position combination information are adjusted to obtain the updated starting position information and the updated ending position information, and each updated starting position information and each updated ending position information are used as the adjusted boundary position combination information.

[0110] Furthermore, the starting position information s i The expression for boundary adjustment is as follows:

[0111]

[0112] End position information e i The expression for boundary adjustment is as follows:

[0113]

[0114] Among them, s' i This is the adjusted starting position information, e' i This is the adjusted end position information. This is the allowable adjustment range corresponding to each boundary position combination information. The allowable adjustment range corresponding to each boundary position combination information can be the same or different. It is usually set to a small value (such as 3) to avoid over-adjustment.

[0115] It needs to be explained that the expression for boundary adjustment of the above starting position information has a search range of up to the original starting position information s. i Between the leftmost δ positions and the original position [s] i -δ, s i Search; the search objective is to find the result Conf(s,e) that makes the second confidence level assessment result Conf(s,e) i The largest new starting position information s' i The search effect is that it can expand the boundary position combination information to the left to include prefix parts that may have been missed.

[0116] The expression for boundary adjustment of the above-mentioned end position information: its search range is within the original end position information e. i Between the leftmost δ positions and the original position [e] i e i +δ] Search; The search objective is to find the result Conf(s) that makes the second confidence level assessment result Conf(s) i e) The largest new end position information e' i The search effect can expand the boundary position combination information to the right to include any suffix parts that may have been missed.

[0117] Therefore, after obtaining multiple adjusted boundary position combination information of an entity, the second confidence evaluation result corresponding to each adjusted boundary position combination information can be detected to determine whether the search is complete. That is, the boundary position combination information with the highest second confidence evaluation result among the multiple adjusted boundary position combination information is taken as the target boundary position combination information of the entity.

[0118] The second confidence assessment result includes the confidence assessment result Conf(s,e) after adjusting the starting position information. i ) and the confidence assessment results corresponding to the adjusted end position information Conf(s) i ,e), and find the second confidence assessment result Conf(s,e) i The largest new starting position information s' i And find the second confidence level assessment result Conf(s) i e) The largest new end position information e' iThis can be achieved through syntactic and semantic rules. That is, syntactic (such as grammatical structure and dependency relations) and semantic (such as semantic roles and lexical associations) rules are transformed into computable features or constraints and incorporated into the confidence function. For example, in the common verb-object syntactic structure "verb + noun," if the initial boundary includes the verb within the noun entity, it violates the syntactic rule, and the corresponding confidence level decreases. Semantically, "apple" and "fruit" have a hierarchical semantic relationship; if the boundary segmentation disrupts this relationship, it will also affect the confidence level. By assigning weights and thresholds to these rules, the confidence function can reflect whether the boundary conforms to the syntactic and semantic rules.

[0119] The second confidence level assessment result can be considered as evaluating the probability that the boundary [s, e] constitutes a valid entity. By searching for the boundary with the highest confidence within a small range, the inaccuracies of the initial boundary identification can be corrected. In addition, setting δ to a small value ensures that the adjustment range is limited, avoiding excessive deviation from the original identification result. Optimization within a local range maintains the rationality of the original identification while allowing for fine adjustments.

[0120] In practical applications, an example of boundary expansion is: Original identification: "Zhang", after optimization: "Zhang San" (expanding to the right to complete the name); an example of boundary contraction is: Original identification: "Power Grid Company A Branch", after optimization: "Power Grid Company" (removing redundant regional modifiers).

[0121] In one embodiment, when the second confidence assessment result corresponding to each adjusted candidate boundary position combination information is detected based on the first confidence assessment result corresponding to each adjusted candidate boundary position combination information in combination with semantic grammar rules, the first confidence assessment result is obtained by multiplying the first probability information and the second probability information of each adjusted candidate boundary position combination information. In practical applications, the first confidence assessment result is given by the MRC model, and semantic grammar rules are added to the MRC probability to obtain the second confidence assessment result corresponding to each adjusted candidate boundary position combination information. For example, "Beijing Branch of a certain power grid company", the grammar rule of this text is: the complete organization name should contain the modifier "certain place"; the semantic rule is: "certain power grid company" is a complete semantic unit, so even if S[0] may be slightly lower than the original probability of S[2], Conf(0,6) (containing "certain place") scores higher than Conf(2,6) (not containing "certain place").

[0122] In other words, the Conf function corresponding to the second confidence level assessment result is an enhanced version of the MRC probability. It takes into account both the original judgment of the model and incorporates syntactic and semantic rules to correct the boundary.

[0123] In the above embodiments, by adjusting the starting and ending position information in the candidate boundary position combination information, the accuracy of the boundary position combination information can be further improved, so as to perform accurate entity recognition.

[0124] In an exemplary embodiment, obtaining the adjustment range corresponding to the boundary position combination information of the entity includes:

[0125] Obtain the initial predicted entity type and first confidence assessment result corresponding to each of the boundary position combination information, as well as the text complexity of the text to be identified; based on the text complexity, initial predicted entity type and first confidence assessment result corresponding to each candidate boundary position combination information, obtain the boundary constraint strength information of multiple candidate boundary position combination information; based on the boundary constraint strength information of multiple candidate boundary position combination information, detect the adjustment range corresponding to each of the multiple boundary position combination information.

[0126] Specifically, in practical applications, different types of entities and texts with different writing styles exhibit varying degrees of sensitivity to boundary constraints. Therefore, this application designs an adaptive boundary constraint strategy that dynamically adjusts the strictness of boundary constraints based on entity type characteristics and text complexity. Specifically, it introduces boundary constraint strength information. To adjust the constraint strength of the i-th boundary, we first need to obtain the initial predicted entity type, the first confidence assessment result, and the text complexity of the text to be recognized for each combination of boundary positions. The initial predicted entity type is the simple entity type predicted before processing by the large language model; this can be a manual prediction or a simple prediction using other models. The first confidence assessment result is the product of the first probability information of the starting position and the second probability information of the ending position in the boundary position combination information. The text complexity of the text to be recognized is calculated based on the sentence length complexity in the text, for example, Comp(X) = len(X) / L. avg len(X): The length of the current text X (or the number of words), L avg : The preset average sentence length benchmark.

[0127] For example, the boundary constraint strength information of the i-th boundary position combination information. The expression is:

[0128]

[0129] in, It is the initial predicted entity type. This is the first confidence level assessment result. Here, f represents the text complexity, and f is the mapping function that transforms these factors into constraint strength parameters. In practical applications, f can be a rule-based mapping or a trained regression model.

[0130] Boundary constraint strength information This determines the permissible adjustment range of the boundary. Therefore, based on the boundary constraint strength information, the adjustment range corresponding to the boundary position combination information can be detected. Specifically... , ,in, This is the maximum allowable adjustment range. and These are the adjustment ranges for the start and end positions, respectively.

[0131] In the above embodiments, the boundary constraint strength information of the boundary position combination information can be accurately detected based on the initial predicted entity type corresponding to each of the entity's boundary position combination information, the first confidence assessment result, and the text complexity of the text to be identified, so as to accurately determine the adjustment range corresponding to the entity's boundary position combination information.

[0132] In an exemplary embodiment, the entity recognition method for text in the power dispatching field further includes:

[0133] The process involves: obtaining an entity type recognition problem template for an entity text fragment and the actual entity type of the text fragment; performing entity type recognition on the text fragment based on the entity type recognition problem template to obtain the predicted entity type of the text fragment; evaluating the first accuracy of the target boundary position combination information based on the actual entity type and the predicted entity type; calculating the similarity and boundary length consistency of multiple text fragments of the same entity in the text to be recognized to obtain the second accuracy of the target boundary position combination information; and determining the validity of the target boundary position combination information based on the first and second accuracy evaluation results.

[0134] Here, "entity text fragment" refers to a text fragment containing information about the target boundary location within the text to be identified. The entity type recognition question template refers to the question of determining what type of entity the text fragment is, for example, "text fragment". "What type of entity is it?"

[0135] Specifically, after adjusting the start and end position information in the candidate boundary position combination information to obtain the target boundary position combination information, the target boundary position combination information can be verified. The verification method can be through boundary reverse verification or boundary consistency verification.

[0136] More specifically, for boundary reverse verification, a reverse verification problem is constructed to check whether the identified boundaries are accurate. Specifically, this involves considering the combination of identified target boundary position information. and entity text fragments Construct a template for entity type recognition problem: "text fragment". "What type of entity is it?" By using a reverse validation model, such as the MRC model, to identify the entity type of the text fragment using an entity type recognition question template, the predicted entity type of the text fragment is obtained. The predicted entity type output by the reverse validation model is then checked to see if it matches the actual entity type of the text fragment. This provides the first accuracy assessment result for the target boundary location combination information. If the predicted entity type matches the actual entity type of the text fragment, the confidence level of the target boundary location combination information is enhanced.

[0137] For boundary consistency verification, a boundary consistency check is performed on similar entities that appear multiple times in the same text to be identified. This ensures that the boundary recognition results of the same or similar entities remain consistent across different boundary positions. This is achieved by calculating the similarity of multiple text segments corresponding to different boundary positions and the consistency of boundary patterns. Specifically, text segment similarity calculation utilizes a semantic similarity algorithm: `semantic_sim = cosine_similarity(embedding(text1), embedding(text2))`, which uses word vectors or sentence vectors to calculate semantic similarity. Based on this semantic similarity, it determines whether multiple text segments corresponding to different boundary positions are consistent, ensuring that the boundary recognition results of the same or similar entities remain consistent across different boundary positions. Boundary pattern consistency uses a boundary length pattern, checking whether the length of similar entities is within a reasonable range using `length_consistency = |len(entity1) - len(entity2)| <= threshold`, ensuring that the boundary recognition results of the same or similar entities remain consistent across different boundary positions. Finally, based on the results of similarity calculation and boundary length consistency judgment for multiple text segments of the same entity in the text to be identified, a second accuracy evaluation result for the target boundary position combination information is obtained.

[0138] Combining the first and second accuracy evaluation results, the validity of the target boundary position combination information is determined. Specifically, both the first and second accuracy evaluation results can be represented as accuracy values. To determine the validity of the target boundary position combination information, the average of the accuracy values ​​corresponding to the first and second accuracy evaluation results can be used. If this average is greater than a preset accuracy threshold, the target boundary position combination information is considered valid; otherwise, it is invalid. Alternatively, both the first and second accuracy evaluation results can be represented as accuracy levels. To determine the validity of the target boundary position combination information, both the accuracy level corresponding to the first and second accuracy evaluation results can be checked to see if they are both greater than a preset accuracy level threshold. If both are greater than the preset accuracy level threshold, the target boundary position combination information is considered valid; otherwise, it is invalid.

[0139] In the above embodiments, by constructing an entity type recognition problem template for entity text fragments, the accuracy of the target boundary position combination information can be reverse-verified by the entity type of the entity text fragments. At the same time, similarity calculation and boundary length consistency judgment can be performed on multiple identical entity text fragments in the text to be recognized to verify the target boundary position combination information again, so that the target boundary position combination information is accurate location information for entity recognition.

[0140] In one exemplary embodiment, such as Figure 3 As shown, S400 includes:

[0141] S420: Obtain the general instruction prefix information, task instruction information, and output format information corresponding to the text to be recognized.

[0142] S440 detects the boundary constraint information of the text to be identified based on the combination of multiple target boundary position information.

[0143] S460 constructs a boundary prompt template for the text to be recognized based on boundary constraint information, the text to be recognized, general instruction prefix information, task instruction information, and output format information.

[0144] S480, based on the boundary cue template, detect entity text fragments of multiple entities in the text to be identified, as well as the predicted entity type and predicted entity attributes of each entity text fragment.

[0145] Specifically, the core of this method is to effectively integrate the combined information of the identified target boundary positions into the inference process of the large language model. Therefore, a structured boundary constraint representation can be designed to encode general instruction prefix information, boundary constraint information, text to be recognized, task instruction information, and output format information into a boundary prompt template.

[0146] Therefore, it is first necessary to obtain the text to be identified, as well as the boundary constraint information, general instruction prefix information, task instruction information and output format information of the text to be identified. Among them, the boundary constraint information is determined by the combination of target boundary position information of multiple entities.

[0147] The boundary hint template is obtained by concatenating the text to be recognized, boundary constraint information, general instruction prefix information, task instruction information, and output format information. For example, given text... and the boundary set of different entities identified The construction expression for the boundary hint template can be as follows:

[0148]

[0149] in, The components representing text concatenation operations are defined as follows: General instruction prefix information clarifies the task objectives and requirements; : The context of the text to be recognized; Boundary constraint information; Task instruction information; Output format information.

[0150] For example, the output format information could be: { "entities": [ { "text": "entity text", "type": "entity type", "start": start position, "end": end position, "confidence": confidence score, "attributes": { "attribute name": "attribute value"}}]}; To enhance the large language model's ability to perceive boundary constraints, the task instruction information explicitly requires the model to pay attention to predefined boundaries, such as: P task =“Please identify entities from the above text, strictly adhering to the given boundary constraints. If the text within the boundaries does not constitute an entity, please ignore it.” For example, a complete boundary hint template could be: P prefix Please identify the entity types in the following text..., P context "A transformer belonging to the power grid company in the Beijing area has malfunctioned," P boundary: "Boundaries marked: Boundary 1 - 'Power Grid Company' [0, 4], Boundary 2 - 'Beijing' [5, 7], Boundary 3 - 'Transformer' [10, 13]", P task "Please determine whether the text within each boundary is an entity...", P output Output format: {entities:[{text:..., type:..., start:...,end:...}]}".

[0151] The boundary set of different entities is obtained by combining the information of the k different target boundary positions identified in the same text to be identified, which can be obtained through the MRC model. For example, if the text to be identified is "The transformer of the power grid company in Beijing has failed", then the boundary set identified by the MRC model is: (s1, e1, p1) = (0, 6, 0.92) → "Power grid company in Beijing"; (s2, e2, p2) = (7, 9, 0.85) → "Beijing"; (s3, e3, p3) = (12, 15, 0.88) → "Transformer".

[0152] Furthermore, based on all the target boundary location combinations, boundary constraint information is generated and embedded into the boundary prompt template: P boundary = "The following possible entity boundaries are marked in the text: Boundary 1: 'Power Grid Company of Location A', location [0, 6], confidence 0.92; Boundary 2: 'Beijing', location [7, 9], confidence 0.85; Boundary 3: 'Transformer', location [12, 15], confidence 0.88". Then, a large language model is used to process all boundaries simultaneously to detect entity text fragments in the text to be identified, as well as the predicted entity type and predicted entity attribute of the entity text fragments. At this point, boundary 1 corresponds to the organization entity type; boundary 2 corresponds to the location entity type; and boundary 3 corresponds to the equipment entity type.

[0153] Following this, under boundary constraints, the goal of entity extraction in the large language model is to determine whether the text within each predefined boundary constitutes a specific type of entity, and further extract its attributes and relationships. Therefore, the boundary prompt template is input into the large language model, and for each boundary in the boundary prompt template... and corresponding text fragments The model needs to determine its entity type. Where C is a predefined set of entity types. This represents a non-valid entity. The reasoning process of a large language model, such as an LLM (Large Language Model), under boundary constraints can be represented as: , where P is the boundary hint template, and Y is the data output by the large language model, including the predicted entity type and predicted entity attributes of the entity text segment.

[0154] Furthermore, in order to structurally represent the extraction results, the output format is defined as: , where i represents the i-th entity number; for example: i = 1 represents the entity recognition result of the first boundary, i = 2 represents the entity recognition result of the second boundary, c i represents the predicted entity type corresponding to the i-th boundary.

[0155] In one embodiment, the construction of [] is crucial. This application combines explicit marking and instruction guidance to combine information according to the target boundary position and construct the boundary constraint information of the text to be recognized.

[0156] Specifically, 1. Explicit marking processing: The purpose is to directly mark the boundary positions recognized by MRC in the original text; specific approach: Insert special marking symbols before and after each recognized boundary. For example, the original text "The transformer fails" → after marking "<Boundary 1>transformer< / Boundary 1> fails".

[0157] 2. Instruction guidance processing: The purpose is to tell the model how to process these marked boundaries through explicit text instructions; the specific content includes: Boundary list: List all recognized boundaries and their basic information, "Boundary 1: Text segment 'transformer', position [0, 3], confidence 0.92", Processing requirements: Clearly tell the model what needs to be done, "Please judge whether the text within each boundary is an entity, and if so, determine the type".

[0158] 3. Combination of the two: Preprocessing stage: Convert the boundary information recognized by MRC into marks and instructions; Mark embedding: Insert boundary marks in the original text to generate marked text; Instruction generation: Automatically generate processing instructions according to the boundary information; Template assembly: Combine the marked text and instructions into a complete prompt in a fixed format.

[0159] In one embodiment, is the boundary constraint information after boundary adjustment for the start position information and end position information in the combined information of each boundary position. When the boundary position combined information is When The expression of [] is:

[0161]

[0162] Among them, is the adjustment range corresponding to the start position information of the entity, The adjustment range corresponding to the end position information of the entity.

[0163] In the above embodiments, a boundary prompt template for the text to be identified can be constructed based on boundary constraint information, text to be identified, general instruction prefix information, task instruction information and output format information. Then, through the boundary prompt template, entity text fragments in the text to be identified, as well as the predicted entity type and predicted entity attributes of the entity text fragments, can be accurately detected.

[0164] In an exemplary embodiment, after detecting the entity recognition results of multiple entity text fragments, the method further includes:

[0165] Based on the entity recognition results of multiple entity text fragments, the number of entities that can be identified in the multiple entity recognition results is detected; based on the number of entities, the boundary compliance rate of the entity recognition results is detected; based on the boundary compliance rate, the accuracy of the multiple entity recognition results under the boundary constraints of the combined information of multiple target boundary positions is evaluated.

[0166] Specifically, based on the entity recognition results of multiple entity text fragments, the number of valid entities that can be identified in the multiple entity recognition results is detected, that is, the number of entity types predicted to be "None" in the multiple entity text fragments that are not invalid entities. The total number of results output by the large language model is also obtained. The large language model is used to detect entity text fragments in the text to be recognized based on boundary cue templates, as well as the predicted entity types and predicted entity attributes of the entity text fragments.

[0167] Based on the number of predicted entity types (not invalid entities, None) in multiple entity text fragments and the total number of results output by the large language model, the boundary compliance rate of the entity recognition results is detected. Furthermore, each boundary in the boundary prompt template... and corresponding text fragments The expression for the BCR (Boundary Compliance Rate) of multiple entity recognition results obtained based on the boundary cue template is as follows:

[0168]

[0169] Where |y| represents the total number of results output by the large language model; None represents invalid entities; i represents the i-th entity number; for example, i=1 represents the entity recognition result of the first boundary, i=2 represents the entity recognition result of the second boundary, and c i Indicates the predicted entity type corresponding to the i-th boundary; It is an indicator function that takes the value 1 when the condition is true, and 0 otherwise.

[0170] In other words, BCR evaluates the overall accuracy of multiple entity outputs. Specifically, it evaluates the extent to which the large language model utilizes all predefined boundaries. It counts how many of the k given boundaries are identified as valid entities by the model. The higher the BCR, the more the model tends to consider the predefined boundaries as valid entities.

[0171] In the above embodiments, by detecting the boundary compliance rate of entity recognition results, it is possible to effectively evaluate whether the recognition results of multiple entities under the boundary constraints of combined information of multiple target boundary positions are accurate. The evaluation method is simple and accurate.

[0172] In an exemplary embodiment, the format of the entity training dataset in the power dispatching domain is shown in Table 1, the performance comparison of different large models on the entity recognition task is shown in Table 2, the comparison of the F1 values ​​of the recognition capabilities of different entity types is shown in Table 3, and the ablation experiment results of the core components are shown in Table 4.

[0173]

[0174]

[0175]

[0176]

[0177] In a detailed embodiment, to achieve entity extraction from a large language model with embedded MRC two-stage collaborative optimization, this method enhances the accuracy of entity recognition in text by integrating the boundary localization advantages of machine reading comprehension with the semantic understanding capabilities of a large language model, providing a more accurate entity foundation for information extraction and knowledge graph construction. This framework mainly comprises two core modules: an MRC-based entity boundary optimization module for the power dispatching domain and a large language model entity extraction module with embedded MRC boundary constraint optimization.

[0178] In the first stage, the MRC-based entity boundary optimization module transforms entity boundary recognition into a precise localization problem by constructing specific question templates (general templates; for different entity types, the following general templates may be used: Equipment entity: "What electrical equipment is mentioned in the text?"; Operation entity: "What operational behaviors are described in the text?"; Location entity: "What locations or positions are mentioned in the text?"; Time entity: "What time information is mentioned in the text?"), such as "What is a transformer in the text?" or "What methods for reducing voltage are mentioned in the text?". The MRC model focuses on solving the "where" problem, that is, accurately finding the possible entity boundary locations in the text and generating a confidence score for each identified boundary. This question-and-answer design fully leverages the advantages of the MRC model in precise localization of text fragments, especially performing excellently when dealing with complex text structures and long-distance dependencies.

[0179] In the second stage, the entity extraction module of the large language model, which incorporates MRC two-stage co-optimization, transforms the boundary information identified by MRC into structured constraints and embeds them into the prompt template. This guides the large language model to determine entity type and understand attributes within a predefined boundary range. This module focuses on solving the "what" problem, namely, determining whether the text fragments within the boundary constitute a specific type of entity and extracting its semantic features. By combining boundary constraints with the reasoning mechanism of the large language model, the model can maintain the depth of semantic understanding while adhering to predefined boundary restrictions, achieving a synergistic optimization of boundary accuracy and semantic richness.

[0180] Specifically, the entity recognition method for text in the field of power dispatching in this application includes:

[0181] The MRC-based boundary recognition model employs an encoder-decoder architecture to obtain the text to be recognized and its entity recognition problem template. The text to be recognized and the entity recognition problem template are concatenated, and the encoder encodes the concatenated information to obtain the contextual representation information of the text to be recognized. The decoder predicts entity location information from the contextual representation information, obtaining multiple candidate boundary location combinations for each different entity in the text to be recognized. For each entity, based on the first and second probability information of each boundary location combination, the first confidence evaluation result of multiple boundary location combinations is detected. From the multiple candidate boundary location combinations of the same entity, the boundary location combination with the highest first confidence evaluation result is selected. Each boundary location combination includes start and end location information.

[0182] For each entity, the initial predicted entity type, first confidence assessment result, and text complexity of the text to be identified are obtained for each boundary position combination information. Based on the text complexity, initial predicted entity type, and first confidence assessment result, the boundary constraint strength information of the boundary position combination information is detected. Based on the boundary constraint strength information, the adjustment range corresponding to the candidate boundary position combination information is detected. Based on the pre-obtained adjustment range, the start and end position information in the boundary position combination information are adjusted to obtain multiple adjusted boundary position combination information, where each adjusted boundary position combination information includes updated start and end position information. Based on the first confidence assessment result and semantic syntax rules corresponding to each adjusted boundary position combination information, the second confidence assessment result corresponding to each adjusted boundary position combination information is detected. From the multiple adjusted boundary position combination information, the boundary position combination information with the highest second confidence assessment result is selected as the target boundary position combination information for the entity.

[0183] At this point, the entity type recognition problem template and the actual entity type of the entity text fragment can be obtained; based on the entity type recognition problem template, entity type recognition is performed on the entity text fragment to obtain the predicted entity type of the entity text fragment; based on the actual entity type and the predicted entity type, the first accuracy evaluation result of the target boundary position combination information is detected; similarity calculation and boundary length consistency judgment are performed on multiple identical entity text fragments in the text to be recognized to obtain the second accuracy evaluation result of the target boundary position combination information; based on the first accuracy evaluation result and the second accuracy evaluation result, it is determined whether the target boundary position combination information is valid.

[0184] The process involves: acquiring general instruction prefix information, task instruction information, and output format information corresponding to the text to be identified; detecting boundary constraint information of the text to be identified based on the combination of multiple target boundary positions; constructing a boundary prompt template for the text to be identified based on the boundary constraint information, the text to be identified, the general instruction prefix information, the task instruction information, and the output format information; processing the boundary prompt template using a large language model to detect multiple entity text fragments in the text to be identified, as well as the predicted entity type and predicted entity attributes of each entity text fragment; and detecting entity text fragments of multiple entities in the text to be identified based on the combination of multiple target boundary positions, and detecting the predicted entity type and predicted entity attributes of multiple entity text fragments.

[0185] Finally, based on the entity recognition results of multiple entity text fragments, the number of entities that can be identified in the multiple entity recognition results is detected; based on the number of entities, the boundary compliance rate of the entity recognition results is detected; based on the boundary compliance rate, the accuracy of the multiple entity recognition results under the boundary constraints of the combined information of multiple target boundary positions is evaluated.

[0186] It should be understood that although the steps in the flowcharts of the above embodiments are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the above embodiments may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.

[0187] Based on the same inventive concept, this application also provides an entity recognition device for text in the power dispatching field for implementing the above-described entity recognition method for text in the power dispatching field. The solution provided by this device is similar to the solution described in the above-described method. Therefore, the specific limitations of one or more embodiments of the entity recognition device for text in the power dispatching field provided below can be found in the limitations of the entity recognition method for text in the power dispatching field described above, and will not be repeated here.

[0188] In one exemplary embodiment, such as Figure 4 As shown, a text entity recognition device in the field of power dispatching is provided, comprising: a data acquisition module 100, a boundary prediction module 200, a boundary adjustment module 300, and an entity recognition module 400, wherein:

[0189] The data acquisition module 100 is used to acquire the text to be identified and the entity recognition problem template of the text to be identified in the field of power dispatching.

[0190] The boundary prediction module 200 is used to predict the entity location information of the text to be identified based on the entity recognition problem template, and obtain the boundary location combination information of multiple entities in the text to be identified. Each boundary location combination information includes start location information and end location information.

[0191] The boundary adjustment module 300 is used to adjust the start position information and end position information in each boundary position combination information to obtain the target boundary position combination information of multiple entities.

[0192] The entity recognition module 400 is used to detect entity text fragments of multiple entities in the text to be recognized based on the combination information of multiple target boundary positions, and to detect the entity recognition results of multiple entity text fragments.

[0193] In one embodiment, the boundary prediction module 200 is further configured to concatenate the text to be identified with the entity recognition problem template, and encode the concatenated information to obtain the context representation information of the text to be identified; predict the entity location information of the context representation information to obtain multiple candidate boundary location combination information corresponding to each entity in the text to be identified; for each entity, detect the first confidence evaluation result of the multiple candidate boundary location combination information, and select the boundary location combination information with the highest first confidence evaluation result from the multiple candidate boundary location combination information.

[0194] In one embodiment, the boundary adjustment module 300 is further configured to: obtain, for each entity, the adjustment range corresponding to the boundary position combination information of the entity; adjust the start position information and end position information in the boundary position combination information according to the pre-obtained adjustment range to obtain multiple adjusted boundary position combination information, wherein each adjusted boundary position combination information includes updated start position information and updated end position information; detect the second confidence evaluation result corresponding to each adjusted boundary position combination information; and select the boundary position combination information with the highest second confidence evaluation result from the multiple adjusted boundary position combination information as the target boundary position combination information of the entity.

[0195] In one embodiment, the boundary adjustment module 300 is further configured to obtain the initial predicted entity type, the first confidence assessment result, and the text complexity of the text to be identified corresponding to each of the boundary position combination information of the entities; detect the boundary constraint strength information of the boundary position combination information based on the text complexity, the initial predicted entity type, and the first confidence assessment result; and detect the adjustment range corresponding to the boundary position combination information based on the boundary constraint strength information.

[0196] In one embodiment, the entity recognition device for text further includes a position verification module, which is used to obtain an entity type recognition problem template for the entity text fragment and the actual entity type of the entity text fragment; perform entity type recognition on the entity text fragment according to the entity type recognition problem template to obtain the predicted entity type of the entity text fragment; detect a first accuracy evaluation result of the target boundary position combination information based on the actual entity type and the predicted entity type; perform similarity calculation and boundary length consistency judgment on multiple identical entity text fragments in the text to be recognized to obtain a second accuracy evaluation result of the target boundary position combination information; and determine whether the target boundary position combination information is valid based on the first accuracy evaluation result and the second accuracy evaluation result.

[0197] In one embodiment, the entity recognition module 400 is used to acquire general instruction prefix information, task instruction information, and output format information corresponding to the text to be recognized; detect the boundary constraint information of the text to be recognized based on the combination information of multiple target boundary positions; construct a boundary prompt template for the text to be recognized based on the boundary constraint information, the text to be recognized, the general instruction prefix information, the task instruction information, and the output format information; and detect entity text fragments of multiple entities in the text to be recognized, as well as the predicted entity type and predicted entity attributes of each entity text fragment, based on the boundary prompt template.

[0198] In one embodiment, the text entity recognition device further includes a recognition result verification module, which is used to detect the number of entities that can be identified in the multiple entity recognition results based on the entity recognition results of multiple entity text fragments; detect the boundary compliance rate of the entity recognition results based on the number of entities; and evaluate whether the multiple entity recognition results are accurate under the boundary constraints of the combination information of multiple target boundary positions based on the boundary compliance rate.

[0199] The various modules in the aforementioned entity recognition device for text in the power dispatching field can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device in hardware form, or stored in the memory of a computer device in software form, so that the processor can call and execute the operations corresponding to each module.

[0200] In one exemplary embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 5 As shown, the computer device includes a processor, memory, input / output (I / O) interfaces, and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides the environment for the operating system and computer programs in the non-volatile storage media to run. The database stores data such as the text to be recognized and entity recognition problem templates for that text. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communicating with external terminals via a network connection. When the computer program is executed by the processor, it implements a text entity recognition method in the field of power dispatching.

[0201] Those skilled in the art will understand that Figure 5 The structure shown is a block diagram of a partial structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have different component arrangements.

[0202] In one embodiment, a computer device is also provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above method embodiments.

[0203] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon that, when executed by a processor, implements the steps in the above method embodiments.

[0204] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above method embodiments.

[0205] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data must comply with relevant regulations.

[0206] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, artificial intelligence (AI) processors, etc., and are not limited to these.

[0207] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.

[0208] The above embodiments are merely illustrative of several implementation methods of this application, and their descriptions are relatively specific and detailed. However, they should not be construed as limiting the scope of this application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.

Claims

1. A method for entity recognition in text within the field of power dispatching, characterized in that, The method includes: Obtain a template for entity recognition problems involving text to be identified in the field of power dispatching; Based on the entity recognition problem template, entity location information is predicted for the text to be recognized to obtain boundary location combination information of multiple entities in the text to be recognized, wherein each boundary location combination information includes start location information and end location information. By adjusting the start position information and the end position information in each of the boundary position combination information, target boundary position combination information of multiple entities is obtained; Based on the combination of multiple target boundary position information, entity text fragments of multiple entities in the text to be identified are detected, and entity recognition results of multiple entity text fragments are detected.

2. The method according to claim 1, characterized in that, The step of predicting entity location information of the text to be identified based on the entity recognition problem template to obtain the boundary location combination information of multiple entities in the text to be identified includes: The text to be identified is concatenated with the entity recognition question template, and the concatenated information is encoded to obtain the contextual representation information of the text to be identified. Entity location information prediction is performed on the context representation information to obtain multiple candidate boundary location combinations for each entity in the text to be identified. For each entity, a first confidence evaluation result of the plurality of candidate boundary position combination information is detected, and the boundary position combination information with the highest first confidence evaluation result is selected from the plurality of candidate boundary position combination information.

3. The method according to claim 1, characterized in that, The step of adjusting the start position information and end position information in each of the boundary position combination information to obtain target boundary position combination information for multiple entities includes: For each entity, obtain the adjustment range corresponding to the boundary position combination information of the entity; Based on the pre-acquired adjustment range, the starting position information and the ending position information in the boundary position combination information are adjusted to obtain multiple adjusted boundary position combination information, wherein each adjusted boundary position combination information includes updated starting position information and updated ending position information. Detect the second confidence assessment result corresponding to each of the adjusted boundary position combination information; From the multiple adjusted boundary position combination information, the boundary position combination information with the highest second confidence evaluation result is selected as the target boundary position combination information of the entity.

4. The method according to claim 3, characterized in that, The adjustment range corresponding to the boundary position combination information of the entity includes: Obtain the initial predicted entity type, the first confidence evaluation result, and the text complexity of the text to be identified for each of the boundary position combinations of the entities. Based on the text complexity, the initial predicted entity type, and the first confidence assessment result, detect the boundary constraint strength information of the boundary position combination information; Based on the boundary constraint strength information, the adjustment range corresponding to the boundary position combination information is detected.

5. The method according to claim 1, characterized in that, The method further includes: Obtain the entity type recognition problem template of the entity text fragment and the actual entity type of the entity text fragment; Based on the entity type recognition problem template, entity type recognition is performed on the entity text fragment to obtain the predicted entity type of the entity text fragment; Based on the real entity type and the predicted entity type, detect the first accuracy evaluation result of the target boundary location combination information; The similarity calculation and boundary length consistency judgment are performed on multiple text fragments of the same entity in the text to be identified to obtain the second accuracy evaluation result of the target boundary position combination information; Based on the first accuracy assessment result and the second accuracy assessment result, determine whether the target boundary position combination information is valid.

6. The method according to claim 1, characterized in that, The step of detecting entity text fragments of multiple entities in the text to be identified based on multiple combinations of target boundary position information, and detecting entity recognition results of multiple entity text fragments, includes: Obtain the general instruction prefix information, task instruction information, and output format information corresponding to the text to be identified; Based on the combination of multiple target boundary position information, the boundary constraint information of the text to be identified is detected; Based on the boundary constraint information, the text to be identified, the general instruction prefix information, the task instruction information, and the output format information, a boundary prompt template for the text to be identified is constructed. Based on the boundary prompt template, detect entity text fragments of multiple entities in the text to be identified, as well as the predicted entity type and predicted entity attributes of each entity text fragment.

7. The method according to claim 1, characterized in that, After detecting the entity recognition results of multiple entity text fragments, the method further includes: Based on the entity recognition results of multiple entity text fragments, detect the number of entities that can be identified as valid entities in the multiple entity recognition results; Based on the quantity information, the boundary compliance rate of the entity recognition result is detected; Based on the boundary compliance rate, the accuracy of multiple entity recognition results under the boundary constraints of multiple target boundary location combination information is evaluated.

8. A text entity recognition device in the field of power dispatching, characterized in that, The device includes: The data acquisition module is used to acquire the text to be identified and the entity recognition problem template of the text to be identified in the field of power dispatching; The boundary prediction module is used to predict the entity position information of the text to be identified based on the entity recognition problem template, and obtain the boundary position combination information of multiple entities in the text to be identified, wherein each boundary position combination information includes start position information and end position information. A boundary adjustment module is used to adjust the start position information and the end position information in each of the boundary position combination information to obtain target boundary position combination information of multiple entities. The entity recognition module is used to detect entity text fragments of multiple entities in the text to be recognized based on multiple target boundary position combination information, and to detect the entity recognition results of the multiple entity text fragments.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 7.