Power grid fault plan entity identification method, device, equipment, medium and product
By combining large language models and professional grid plan dictionary knowledge base, the grid fault plan entity recognition method is optimized, and the traditional model's lack of recognition in small sample scenarios is solved, and efficient and accurate entity recognition is achieved.
Patent Information
- Application Number
- CN202411820092.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-11
- Publication Date
- 2025-09-02
- Estimated Expiration
- 2044-12-11
AI Technical Summary
Traditional deep learning models perform poorly in small samples, and the accuracy and reliability of grid fault plan entity recognition are insufficient, especially when facing long term terms and complex grammars unique to the grid field, the recognition accuracy is limited.
A large language model is used to combine the professional dictionary knowledge base of power grid plans, and the entity recognition framework is designed by calculating semantic similarity, constructing candidate location intervals and verifying entity-related knowledge, and optimizing the entity recognition process.
It improves the accuracy and reliability of entity identification of power grid fault plan, adapts to small sample scenarios, reduces cost and time requirements, and improves identification accuracy.
Smart Images

Figure CN119670754B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of entity identification, and in particular to a method, device, equipment, medium and product for entity identification of a power grid fault plan. Background Art
[0002] As the digitalization and intelligentization of power grid systems accelerate, their stability, security, and management efficiency are becoming increasingly important. Grid dispatching, maintenance, and fault handling are crucial to the smooth operation of the power grid industry. In particular, in emergencies such as grid failures, rapid responses are required to ensure the continuity and security of power supply. To achieve intelligent control and automated maintenance, the demand for data utilization and text analysis in power grid systems is becoming increasingly evident. This process has accumulated a large amount of emergency plan documents and fault reports, which contain key information such as fault type, equipment information, fault cause, and remediation measures. Automatically extracting this critical information facilitates data-driven analysis and intelligent decision-making for power grid operations and maintenance.
[0003] Despite the vast amount of textual data available in the power grid industry, traditional named entity recognition methods have significant shortcomings when processing these textual resources. While typical deep learning models perform well when trained on large amounts of labeled data, the power grid industry's high level of expertise and specialized data samples make it difficult to obtain high-quality, fully labeled training data on a large scale. Furthermore, traditional named entity recognition methods have limited accuracy in small sample sizes, particularly when faced with the long terms, abbreviations, and complex grammar unique to the power grid sector. Traditional named entity recognition methods often fall short of accuracy requirements.
[0004] In summary, the poor performance of traditional deep learning models in small sample situations and the poor generalization of different types of power grid plan extraction result in low accuracy and reliability in power grid fault plan entity recognition. Summary of the Invention
[0005] The purpose of this application is to provide a method, device, equipment, medium and product for identifying entities in power grid fault plans, which can solve the problems of poor performance of traditional deep learning models in small sample conditions and poor generalization of extraction of different types of power grid plans, and improve the accuracy and reliability of power grid fault plan entity identification.
[0006] To achieve the above objectives, this application provides the following solutions:
[0007] In a first aspect, the present application provides a method for identifying entities in a power grid fault plan, comprising:
[0008] The semantic similarity between each power grid fault plan text in the small sample power grid fault plan set and the power grid fault plan text to be annotated is calculated respectively; each power grid fault plan text in the small sample power grid fault plan set is annotated with entities of the preset entity type to be identified;
[0009] The preset entity type to be identified, the target power grid fault plan text set, and the power grid fault plan text to be labeled are combined into a first prompt word, and are input into a large language model to obtain a first entity set and the confidence of each entity in the first entity set; the target power grid fault plan text set includes the top k power grid fault plan texts in the small sample power grid fault plan set, which are sorted from large to small according to semantic similarity; the first entity set includes all entities in the power grid fault plan text to be labeled that meet the preset entity type to be identified;
[0010] Constructing multiple candidate location intervals according to the starting position and the ending position of each entity in the first entity set whose confidence is less than a set threshold in the power grid fault plan text to be annotated;
[0011] According to the categories of each entity in the target entity set in the power grid emergency plan professional dictionary knowledge base, relevant knowledge of each entity in the target entity set is obtained; the entities in the power grid emergency plan professional dictionary knowledge base are classified and stored; the target entity set is the intersection of the power grid emergency plan professional dictionary knowledge base and the candidate entity set; the candidate entity set includes the entities corresponding to each candidate position interval in the power grid fault emergency plan text to be annotated;
[0012] The preset entity type to be identified, relevant knowledge of each entity in the target entity set, and each entity in the target entity set are combined into a second prompt word, and the second prompt word is input into the large language model to obtain a second entity set; the second entity set includes all entities in the target entity set that meet the preset entity type to be identified;
[0013] Entities in the first entity set whose confidence is greater than or equal to a set threshold and all entities in the second entity set are determined as final entity results of the power grid fault plan text to be labeled.
[0014] Optionally, respectively calculating the semantic similarity between each power grid fault contingency plan text in the small sample power grid fault contingency plan set and the power grid fault contingency plan text to be annotated specifically includes:
[0015] For any grid fault plan text in the small sample grid fault plan set, use the pre-trained sentence vector model to process the grid fault plan text in the small sample grid fault plan set and the grid fault plan text to be labeled, and obtain the semantic embedding representation of the grid fault plan text in the small sample grid fault plan set and the semantic embedding representation of the grid fault plan text to be labeled;
[0016] The cosine similarity between the semantic embedding representation of the power grid fault plan text in the small sample power grid fault plan set and the semantic embedding representation of the power grid fault plan text to be labeled is calculated to obtain the semantic similarity between the power grid fault plan text in the small sample power grid fault plan set and the power grid fault plan text to be labeled.
[0017] Optionally, constructing a plurality of candidate position intervals based on the starting position and the ending position of each entity in the first entity set whose confidence level is less than a set threshold in the power grid fault plan text to be annotated specifically includes:
[0018] For any entity in the first entity set whose confidence is less than a set threshold, the minimum position is obtained by subtracting a preset hyperparameter value from the starting position of the entity in the power grid fault plan text to be annotated;
[0019] The maximum position is obtained by adding the end position of the entity in the power grid fault plan text to be annotated to the preset hyperparameter value;
[0020] A first interval is constructed with the minimum position as the left endpoint of the first interval and the maximum position as the right endpoint of the first interval; the first interval is a closed interval;
[0021] For the i-th integer value in the first interval, use the i-th integer value as the left endpoint and all values in the integer value set as the right endpoint to obtain all candidate position intervals corresponding to the i-th integer value; the integer value set includes all integer values greater than or equal to the i-th integer value in the first interval;
[0022] Increment the value of i by 1 and return the steps of obtaining all candidate position intervals corresponding to the i-th integer value in the first interval, with the i-th integer value as the left endpoint and all values in the integer value set as the right endpoints, until all candidate position intervals corresponding to the N-th integer value are obtained; N is the total number of all integer values in the first interval.
[0023] Optionally, obtaining relevant knowledge of each entity in the target entity set according to the category of each entity in the target entity set in the power grid emergency plan professional dictionary knowledge base specifically includes:
[0024] For any entity in the candidate entity set, determining whether the entity exists in the power grid emergency plan professional dictionary knowledge base to obtain a first determination result;
[0025] If the first judgment result is yes, then relevant knowledge of the entity is obtained according to the category of the entity in the power grid emergency plan professional dictionary knowledge base.
[0026] Optionally, before respectively calculating the semantic similarity between each power grid fault contingency plan text in the small sample power grid fault contingency plan set and the power grid fault contingency plan text to be annotated, the method includes:
[0027] The professional terms extracted from the power grid text are stored in three categories: abbreviations, synonyms and proper noun explanations, and a professional dictionary knowledge base for power grid emergency plans is obtained.
[0028] Optionally, obtaining relevant knowledge of the entity according to the category of the entity in the power grid emergency plan professional dictionary knowledge base specifically includes:
[0029] If the category of the entity in the power grid plan professional dictionary knowledge base is an abbreviation, then the relevant knowledge of the entity is the entity and the full name of the entity;
[0030] If the category of the entity in the power grid plan professional dictionary knowledge base is a synonym, then the relevant knowledge of the entity is the entity, the synonyms of the entity, and the glossary of the entity;
[0031] If the category of the entity in the power grid plan professional dictionary knowledge base is a proper noun explanation, then the relevant knowledge of the entity is the entity and the proper noun explanation of the entity.
[0032] In a second aspect, the present application provides a power grid fault plan entity identification device, comprising:
[0033] A semantic similarity calculation module is used to respectively calculate the semantic similarity between each power grid fault plan text in the small sample power grid fault plan set and the power grid fault plan text to be annotated; each power grid fault plan text in the small sample power grid fault plan set is annotated with an entity of a preset entity type to be identified;
[0034] A first prompt word recognition module is configured to form a first prompt word from the preset entity type to be identified, the target power grid fault plan text set, and the power grid fault plan text to be labeled, and input the first prompt word into a large language model to obtain a first entity set and the confidence level of each entity in the first entity set; the target power grid fault plan text set includes the top k power grid fault plan texts in the small sample power grid fault plan set, sorted from largest to smallest according to semantic similarity; the first entity set includes all entities in the power grid fault plan text to be labeled that meet the preset entity type to be identified;
[0035] a candidate location interval determination module, configured to construct a plurality of candidate location intervals according to the starting position and the ending position of each entity in the first entity set whose confidence level is less than a set threshold in the power grid fault plan text to be annotated;
[0036] The relevant knowledge determination module is used to obtain relevant knowledge of each entity in the target entity set according to the category of each entity in the power grid emergency plan professional dictionary knowledge base; the entities in the power grid emergency plan professional dictionary knowledge base are classified and stored; the target entity set is the intersection of the power grid emergency plan professional dictionary knowledge base and the candidate entity set; the candidate entity set includes the entities corresponding to each candidate position interval in the power grid fault emergency plan text to be annotated;
[0037] a second prompt word recognition module, configured to combine the preset entity type to be recognized, relevant knowledge of each entity in the target entity set, and each entity in the target entity set into a second prompt word, and input the second prompt word into the large language model to obtain a second entity set; the second entity set includes all entities in the target entity set that match the preset entity type to be recognized;
[0038] The final entity result determination module is used to determine that entities in the first entity set whose confidence is greater than or equal to a set threshold and all entities in the second entity set are the final entity results of the power grid fault plan text to be marked.
[0039] In a third aspect, the present application provides a computer device comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement any one of the above-described methods for identifying entities in power grid fault plans.
[0040] In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements any of the above-mentioned methods for identifying entities in power grid fault plans.
[0041] In a fifth aspect, the present application provides a computer program product, including a computer program, which, when executed by a processor, implements any of the above-mentioned power grid fault plan entity identification methods.
[0042] According to the specific embodiments provided in this application, this application has the following technical effects:
[0043] The present application provides a method, apparatus, equipment, medium and product for identifying entities of power grid fault plans. The large language model is pre-trained on a large amount of general corpus and has strong zero-sample and small-sample (zero-shot, few-shot) learning capabilities. The present application uses a large language model for entity recognition to solve the problems of poor performance of traditional deep learning models in small sample situations and poor generalization of different types of power grid plans. By providing a small number of domain examples to the large language model and designing an effective prompt project, the present application designs a recognition framework of "recall (determining the target power grid fault plan text set based on similarity) - extraction (constructing the first prompt word and inputting it into the large language model) - verification (constructing the candidate position interval, obtaining the relevant knowledge of each entity in the target entity set, constructing the second prompt word, and inputting it into the large language model and obtaining the final entity result)", combining the power grid dictionary and small sample examples into the large language model, and optimizing its reasoning ability on the basis of enhancing relevant knowledge. Ultimately, this method can improve the accuracy and reliability of the large language model in the entity recognition of power grid fault plans. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0045] Figure 1 This is a flow chart of a method for identifying entities in a power grid fault plan in one embodiment of the present application;
[0046] Figure 2 A schematic diagram of the structure of a computer device provided in one embodiment of the present application. DETAILED DESCRIPTION
[0047] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0048] In order to make the above-mentioned purposes, features and advantages of the present application more obvious and easy to understand, the present application is further described in detail below with reference to the accompanying drawings and specific implementation methods.
[0049] In an exemplary embodiment, Figure 1As shown, a method for identifying entities in a power grid fault plan is provided, comprising the following steps, wherein:
[0050] Step 201: Calculate the semantic similarity between each power grid fault plan text in the small sample power grid fault plan set and the power grid fault plan text to be annotated. Each power grid fault plan text in the small sample power grid fault plan set is annotated with an entity of a preset entity type to be identified.
[0051] Step 202: The preset entity type to be identified, the target grid fault plan text set, and the grid fault plan text to be labeled are combined into a first prompt word and input into a large language model to obtain a first entity set and the confidence level of each entity in the first entity set. The target grid fault plan text set includes the top k grid fault plan texts in the small sample grid fault plan set, sorted from highest to lowest by semantic similarity; the first entity set includes all entities in the grid fault plan text to be labeled that match the preset entity type to be identified.
[0052] Step 203: construct multiple candidate position intervals according to the starting position and the ending position of each entity in the first entity set whose confidence level is less than a set threshold in the power grid fault plan text to be annotated.
[0053] Step 204: Obtain relevant knowledge of each entity in the target entity set according to the category of each entity in the power grid plan professional dictionary knowledge base; the entities in the power grid plan professional dictionary knowledge base are classified and stored; the target entity set is the intersection of the power grid plan professional dictionary knowledge base and the candidate entity set; the candidate entity set includes the entities corresponding to each candidate position interval in the power grid fault plan text to be marked.
[0054] Step 205: The preset entity type to be identified, relevant knowledge of each entity in the target entity set, and each entity in the target entity set are combined into a second prompt word and input into the large language model to obtain a second entity set; the second entity set includes all entities in the target entity set that meet the preset entity type to be identified.
[0055] Step 206: Determine that entities in the first entity set whose confidence is greater than or equal to a set threshold and all entities in the second entity set are final entity results of the power grid fault plan text to be annotated.
[0056] Implementing the above steps 201 to 206 can solve the problems of poor performance of traditional deep learning models in small sample conditions and poor generalization of extraction of different types of power grid plans, and improve the accuracy and reliability of power grid fault plan entity recognition.
[0057] In an exemplary embodiment, respectively calculating the semantic similarity between each power grid fault plan text in the small sample power grid fault plan set and the power grid fault plan text to be annotated specifically includes:
[0058] For any power grid fault plan text S in the small sample power grid fault plan set i , use the pre-trained sentence vector model to classify the power grid fault plan text in the small sample power grid fault plan set and the power grid fault plan text to be labeled S test Processing is performed to obtain the semantic embedding representation of the power grid fault plan text in the small sample power grid fault plan set and the semantic embedding representation of the power grid fault plan text to be annotated. The semantic embedding representation formula generated using the pre-trained sentence vector model (such as bge) is expressed as: emb(S test )=f(S test ),emb(S i )=f(S i ), where f() represents the embedding generation function, i.e., the pre-trained sentence vector model; emb() represents the semantic embedding representation.
[0059] Calculate the cosine similarity between the semantic embedding representation of the power grid fault plan text in the small sample power grid fault plan set and the semantic embedding representation of the power grid fault plan text to be annotated, and obtain the semantic similarity between the power grid fault plan text in the small sample power grid fault plan set and the power grid fault plan text to be annotated. Specifically: According to the formula Similarity(S test ,S i )=cos(emb(S i ),emb(S test )) Calculate the semantic embedding representation emb(S i ) and the semantic embedding representation of the power grid fault plan text to be annotated emb(S test )'s cosine similarity(S test ,S i ).
[0060] In an exemplary embodiment, after calculating the semantic similarity, the method further includes:
[0061] Similarity normalization: In order to standardize the similarity score and ensure that all similarity values are in the same range, the similarity score i , perform normalization:
[0062]
[0063] Among them, score i =Similarity(S test ,S i) represents the similarity score of the i-th power grid fault plan text, N(score i ) represents the power grid fault plan text S to be marked test and the i-th power grid fault plan text S in the small sample power grid fault plan set i The normalized cosine similarity of the grid fault plan text S to be annotated; max(score) represents test The maximum value of the cosine similarity with all power grid fault plan texts in the small sample power grid fault plan set.
[0064] After normalization, the similarity score N(score i ), select the first k largest similarity scores corresponding to the power grid fault plan text as the final recall example. That is, S that meets the following conditions i Selected:
[0065] S selected ={S i |N(score i ) are the first k maximum values}={S1,S2,…,S k}
[0066] The final S selected The power grid fault plan text in will be used as part of the prompt words to assist the further understanding and reasoning of the large language model.
[0067] In an exemplary embodiment, the preset entity type to be identified, the target power grid fault plan text set, and the power grid fault plan text to be labeled are combined into a first prompt word, specifically:
[0068] Input preparation: Using the target power grid fault plan text set S selected , which is spliced with the predefined first prompt word template to create a prompt containing the power grid fault plan text and context.
[0069] Prompt word template construction: S selected The following first prompt word template format (as shown in Table 1) is spliced together to generate a complete input prompt.
[0070] Among them, the target is filled in with the set task background, prompting the large language model to analyze the text as an expert in the power grid industry.
[0071] Insert a specific entity type description (such as "grid equipment" or "fault type") into the entity type description to help the model understand the category of the target entity.
[0072] Fill in S1, S2, ..., S in the example k , to demonstrate how the target entity is extracted.
[0073] Fill in the sentence with the text of the power grid fault plan to be marked S test .
[0074] The problem guides the model to S test Perform entity recognition, including detailed steps to ensure the model fully understands the task.
[0075] Table 1
[0076]
[0077]
[0078] In an exemplary embodiment, the step of constructing multiple candidate location intervals based on the starting position and the ending position of each entity in the first entity set whose confidence level is less than a set threshold in the power grid fault plan text to be annotated specifically includes:
[0079] For any entity in the first entity set whose confidence is less than the set threshold (60%), the starting position of the entity in the power grid fault plan text to be annotated is used. Subtract the preset hyperparameter value α to get the minimum position.
[0080] The end position of the entity in the power grid fault plan text to be annotated Adding the preset hyperparameter values yields the maximum position.
[0081] The first interval is constructed with the minimum position as the left endpoint of the first interval and the maximum position as the right endpoint of the first interval; the first interval is a closed interval. To improve the recognition accuracy, the hyperparameter α is used to expand the start and end positions to obtain the first interval.
[0082] For the i-th integer value in the first interval, take the i-th integer value as the left endpoint and all values in the integer value set as the right endpoint to obtain all candidate position intervals corresponding to the i-th integer value; the integer value set includes all integer values greater than or equal to the i-th integer value in the first interval.
[0083] Increment the value of i by 1 and return the steps of obtaining all candidate position intervals corresponding to the i-th integer value in the first interval, with the i-th integer value as the left endpoint and all values in the integer value set as the right endpoints, until all candidate position intervals corresponding to the N-th integer value are obtained; N is the total number of all integer values in the first interval.
[0084] In an exemplary embodiment, obtaining relevant knowledge of each entity in the target entity set according to the category of each entity in the power grid emergency plan professional dictionary knowledge base specifically includes:
[0085] For any entity in the candidate entity set, it is determined whether the entity exists in the power grid plan professional dictionary knowledge base to obtain a first determination result.
[0086] If the first judgment result is yes, the candidate location interval corresponding to the entity is considered valid, the entity passes the verification, and the relevant knowledge of the entity is obtained according to the category of the entity in the power grid plan professional dictionary knowledge base.
[0087] If the first judgment result is no, the candidate position interval corresponding to the entity is considered as noise and is eliminated.
[0088] In an exemplary embodiment, for each entity in the target entity set, the entity type is reassigned to each candidate position interval by combining relevant knowledge with the reasoning ability of a large language model. This application designs prompt words to guide the model to complete this task efficiently. The second prompt word is composed of the preset entity type to be identified, the relevant knowledge of each entity in the target entity set, and each entity in the target entity set. Specifically,
[0089] Among them, the target is filled in with the set task background, prompting the large language model to analyze the text as an expert in the power grid industry.
[0090] Insert a specific entity type description (such as "grid equipment" or "fault type") into the entity type description to help the model understand the category of the target entity.
[0091] Fill in the entities in the target entity set in the entity field.
[0092] Fill in the entity background knowledge with the relevant knowledge of each entity in the target entity set, as shown in Table 2.
[0093] Table 2
[0094]
[0095]
[0096] Using the second prompt, the model generates inference results for each entity in the target entity set and, combined with the entity type description, assigns the most appropriate entity type. This process ensures further optimization of recognition results through expansion and validation, improving overall recognition accuracy and reliability.
[0097] In an exemplary embodiment, before respectively calculating the semantic similarity between each power grid fault contingency plan text in the small sample power grid fault contingency plan set and the power grid fault contingency plan text to be annotated, the method includes:
[0098] Professional terms extracted from power grid texts are organized into three categories: abbreviations, synonyms, and proper noun explanations, creating a professional dictionary knowledge base for power grid emergency plans. Specifically, professional terms are extracted from various power grid texts, including power grid standard documents, equipment maintenance standards, and fault handling records. Power grid experts categorize and organize the collected terms into three main categories: abbreviations, synonyms, and proper noun explanations. This creates a professional dictionary knowledge base for power grid emergency plans (KB) to validate and expand low-confidence entity candidates.
[0099] In an exemplary embodiment, obtaining relevant knowledge of the entity according to the category of the entity in the power grid emergency plan professional dictionary knowledge base specifically includes:
[0100] If the category of the entity in the power grid plan professional dictionary knowledge base is an abbreviation, then the relevant knowledge of the entity is the entity and the full name of the entity.
[0101] If the category of the entity in the power grid plan professional dictionary knowledge base is a synonym, then the relevant knowledge of the entity is the entity, the synonyms of the entity, and the glossary of the entity.
[0102] If the category of the entity in the power grid plan professional dictionary knowledge base is a proper noun explanation, then the relevant knowledge of the entity is the entity and the proper noun explanation of the entity.
[0103] This application has significant technical advantages in entity identification for power grid fault emergency plans, as shown in the following aspects:
[0104] Adaptable to small sample scenarios: Traditional deep learning models require large amounts of labeled data to achieve good results, and different types of scenarios need to be re-labeled and retrained, which is time-consuming and labor-intensive. In contrast, this application leverages the zero-shot and few-shot learning capabilities of large language models to achieve efficient and accurate entity recognition even in situations with limited labeled data, significantly saving cost and time.
[0105] Improved recognition accuracy: This application designs a "recall (determine the target power grid fault plan text set based on similarity) - extraction (construct the first prompt word and input it into the large language model) - verification (construct candidate location intervals, obtain relevant knowledge of each entity in the target entity set, construct the second prompt word, input it into the large language model, and obtain the final entity result)" framework, combining the power grid plan professional dictionary (knowledge base) with the large language model to improve the recognition accuracy of key entities. Especially when dealing with low-confidence results, through location interval expansion and knowledge base verification, misjudgment is effectively reduced, ensuring that the extracted entities meet the actual needs of the power grid field.
[0106] The above technical advantages enable this application to improve the efficiency and accuracy of power grid fault plan information extraction, providing strong support for intelligent analysis and rapid response of power grid systems.
[0107] Based on the same inventive concept, the embodiments of the present application also provide a power grid fault plan entity identification device for implementing the power grid fault plan entity identification method involved above. The implementation solution provided by the device is similar to the implementation solution described in the above method, so the specific limitations in one or more power grid fault plan entity identification device embodiments provided below can be found in the above limitations of the power grid fault plan entity identification method, and will not be repeated here.
[0108] In an exemplary embodiment, a power grid fault plan entity identification device is provided, comprising:
[0109] The semantic similarity calculation module is used to respectively calculate the semantic similarity between each power grid fault plan text in the small sample power grid fault plan set and the power grid fault plan text to be marked; each power grid fault plan text in the small sample power grid fault plan set is marked with an entity of a preset entity type to be identified.
[0110] A first prompt word recognition module is configured to combine the preset entity type to be identified, the target power grid fault plan text set, and the power grid fault plan text to be labeled into a first prompt word, and input the word into a large language model to obtain a first entity set and the confidence level of each entity in the first entity set; the target power grid fault plan text set includes the top k power grid fault plan texts in the small sample power grid fault plan set, sorted from largest to smallest according to semantic similarity; and the first entity set includes all entities in the power grid fault plan text to be labeled that meet the preset entity type to be identified.
[0111] The candidate location interval determination module is used to construct multiple candidate location intervals according to the starting position and ending position of each entity in the first entity set whose confidence is less than a set threshold in the power grid fault plan text to be marked.
[0112] The relevant knowledge determination module is used to obtain the relevant knowledge of each entity in the target entity set according to the category of each entity in the power grid plan professional dictionary knowledge base; the entities in the power grid plan professional dictionary knowledge base are classified and stored; the target entity set is the intersection of the power grid plan professional dictionary knowledge base and the candidate entity set; the candidate entity set includes the entities corresponding to each candidate position interval in the power grid fault plan text to be marked.
[0113] The second prompt word recognition module is used to form a second prompt word from the preset entity type to be recognized, the relevant knowledge of each entity in the target entity set, and each entity in the target entity set, and input it into the large language model to obtain a second entity set; the second entity set includes all entities in the target entity set that meet the preset entity type to be recognized.
[0114] The final entity result determination module is used to determine that entities in the first entity set whose confidence is greater than or equal to a set threshold and all entities in the second entity set are the final entity results of the power grid fault plan text to be marked.
[0115] In an exemplary embodiment, a computer device is provided. The computer device may be a server or a terminal. The internal structure diagram thereof may be as follows: Figure 2 As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, abbreviated as I / O) and a communication interface. The processor, memory and input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and computer program in the non-volatile storage medium. The database of the computer device is used to store power grid fault plan entity identification data. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a power grid fault plan entity identification method is implemented.
[0116] Those skilled in the art will understand that Figure 2 The structure shown in the figure is merely a block diagram of a portion of the structure related to the solution of the present application and does not constitute a limitation on the computer device to which the solution of the present application is applied. A specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement. In an exemplary embodiment, a computer device is provided, including a memory and a processor. The memory stores a computer program, and the processor implements the above-mentioned method embodiments when executing the computer program.
[0117] In an exemplary embodiment, a computer-readable storage medium is provided, storing a computer program, which implements the above-mentioned method embodiments when executed by a processor.
[0118] In an exemplary embodiment, a computer program product is provided, including a computer program. When the computer program is executed by a processor, the above method embodiments are implemented.
[0119] 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, stored data, displayed data, 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 relevant data must comply with relevant regulations.
[0120] In this application, all actions to obtain signals, information or data are carried out in compliance with the relevant data protection laws and policies of the country where they are located and with the authorization given by the owner of the corresponding device.
[0121] Those skilled in the art will understand that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, database or other media used in the embodiments provided in this application may include at least one of non-volatile and volatile memory. Non-volatile memory may 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 may include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM may be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).
[0122] The databases involved in the various embodiments provided herein may include at least one of a relational database and a non-relational database. Non-relational databases may include, but are not limited to, distributed databases based on blockchains. The processors involved in the various embodiments provided herein may include, but are not limited to, general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic units, data processing logic units based on quantum computing, and the like.
[0123] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, 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 specification.
[0124] This document uses specific examples to illustrate the principles and implementation methods of this application. The description of the above examples is only intended to help understand the method and core concept of this application. At the same time, for those skilled in the art, based on the concept of this application, there may be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as limiting this application.
Claims
1. A method for identifying entities in a power grid fault plan, characterized in that: The power grid fault plan entity identification method includes: The semantic similarity between each power grid fault plan text in the small sample power grid fault plan set and the power grid fault plan text to be annotated is calculated respectively; each power grid fault plan text in the small sample power grid fault plan set is annotated with entities of the preset entity type to be identified; The preset entity type to be identified, the target power grid fault plan text set, and the power grid fault plan text to be labeled are combined into a first prompt word, and are input into a large language model to obtain a first entity set and the confidence of each entity in the first entity set; the target power grid fault plan text set includes the top k power grid fault plan texts in the small sample power grid fault plan set, which are sorted from large to small according to semantic similarity; the first entity set includes all entities in the power grid fault plan text to be labeled that meet the preset entity type to be identified; Constructing multiple candidate location intervals according to the starting position and the ending position of each entity in the first entity set whose confidence is less than a set threshold in the power grid fault plan text to be annotated; According to the categories of each entity in the target entity set in the power grid emergency plan professional dictionary knowledge base, relevant knowledge of each entity in the target entity set is obtained; the entities in the power grid emergency plan professional dictionary knowledge base are classified and stored; the target entity set is the intersection of the power grid emergency plan professional dictionary knowledge base and the candidate entity set; the candidate entity set includes the entities corresponding to each candidate position interval in the power grid fault emergency plan text to be annotated; The preset entity type to be identified, relevant knowledge of each entity in the target entity set, and each entity in the target entity set are combined into a second prompt word, and the second prompt word is input into the large language model to obtain a second entity set; the second entity set includes all entities in the target entity set that meet the preset entity type to be identified; Entities in the first entity set whose confidence is greater than or equal to a set threshold and all entities in the second entity set are determined as final entity results of the power grid fault plan text to be labeled.
2. The method for identifying entities in a power grid fault plan according to claim 1, characterized in that: The calculating of the semantic similarity between each power grid fault plan text in the small sample power grid fault plan set and the power grid fault plan text to be annotated specifically includes: For any grid fault plan text in the small sample grid fault plan set, use the pre-trained sentence vector model to process the grid fault plan text in the small sample grid fault plan set and the grid fault plan text to be labeled, and obtain the semantic embedding representation of the grid fault plan text in the small sample grid fault plan set and the semantic embedding representation of the grid fault plan text to be labeled; The cosine similarity between the semantic embedding representation of the power grid fault plan text in the small sample power grid fault plan set and the semantic embedding representation of the power grid fault plan text to be labeled is calculated to obtain the semantic similarity between the power grid fault plan text in the small sample power grid fault plan set and the power grid fault plan text to be labeled.
3. The method for identifying entities in a power grid fault plan according to claim 1, characterized in that: The step of constructing a plurality of candidate position intervals based on the starting position and the ending position of each entity in the first entity set whose confidence level is less than a set threshold in the power grid fault plan text to be annotated specifically includes: For any entity in the first entity set whose confidence is less than a set threshold, the minimum position is obtained by subtracting a preset hyperparameter value from the starting position of the entity in the power grid fault plan text to be annotated; The maximum position is obtained by adding the end position of the entity in the power grid fault plan text to be annotated to the preset hyperparameter value; A first interval is constructed with the minimum position as the left endpoint of the first interval and the maximum position as the right endpoint of the first interval; the first interval is a closed interval; For the i-th integer value in the first interval, use the i-th integer value as the left endpoint and all values in the integer value set as the right endpoint to obtain all candidate position intervals corresponding to the i-th integer value; the integer value set includes all integer values greater than or equal to the i-th integer value in the first interval; Increment the value of i by 1 and return the steps of obtaining all candidate position intervals corresponding to the i-th integer value in the first interval, with the i-th integer value as the left endpoint and all values in the integer value set as the right endpoints, until all candidate position intervals corresponding to the N-th integer value are obtained; N is the total number of all integer values in the first interval.
4. The method for identifying entities in a power grid fault plan according to claim 1, characterized in that: The step of obtaining relevant knowledge of each entity in the target entity set according to the category of each entity in the power grid emergency plan professional dictionary knowledge base specifically includes: For any entity in the candidate entity set, determining whether the entity exists in the power grid emergency plan professional dictionary knowledge base to obtain a first determination result; If the first judgment result is yes, then relevant knowledge of the entity is obtained according to the category of the entity in the power grid emergency plan professional dictionary knowledge base.
5. The method for identifying entities in a power grid fault plan according to claim 4, characterized in that: Before respectively calculating the semantic similarity between each power grid fault plan text in the small sample power grid fault plan set and the power grid fault plan text to be annotated, the following steps are included: The professional terms extracted from the power grid text are stored in three categories: abbreviations, synonyms and proper noun explanations, and a professional dictionary knowledge base for power grid emergency plans is obtained.
6. The method for identifying entities in a power grid fault plan according to claim 5, characterized in that: According to the category of the entity in the power grid plan professional dictionary knowledge base, relevant knowledge of the entity is obtained, specifically including: If the category of the entity in the power grid plan professional dictionary knowledge base is an abbreviation, then the relevant knowledge of the entity is the entity and the full name of the entity; If the category of the entity in the power grid plan professional dictionary knowledge base is a synonym, then the relevant knowledge of the entity is the entity, the synonyms of the entity, and the glossary of the entity; If the category of the entity in the power grid plan professional dictionary knowledge base is a proper noun explanation, then the relevant knowledge of the entity is the entity and the proper noun explanation of the entity.
7. A power grid fault plan entity identification device, characterized in that: The power grid fault plan entity identification device includes: A semantic similarity calculation module is used to respectively calculate the semantic similarity between each power grid fault plan text in the small sample power grid fault plan set and the power grid fault plan text to be annotated; each power grid fault plan text in the small sample power grid fault plan set is annotated with an entity of a preset entity type to be identified; A first prompt word recognition module is configured to form a first prompt word from the preset entity type to be identified, the target power grid fault plan text set, and the power grid fault plan text to be labeled, and input the first prompt word into a large language model to obtain a first entity set and the confidence level of each entity in the first entity set; the target power grid fault plan text set includes the top k power grid fault plan texts in the small sample power grid fault plan set, sorted from largest to smallest according to semantic similarity; the first entity set includes all entities in the power grid fault plan text to be labeled that meet the preset entity type to be identified; a candidate location interval determination module, configured to construct a plurality of candidate location intervals according to the starting position and the ending position of each entity in the first entity set whose confidence level is less than a set threshold in the power grid fault plan text to be annotated; The relevant knowledge determination module is used to obtain relevant knowledge of each entity in the target entity set according to the category of each entity in the power grid emergency plan professional dictionary knowledge base; the entities in the power grid emergency plan professional dictionary knowledge base are classified and stored; the target entity set is the intersection of the power grid emergency plan professional dictionary knowledge base and the candidate entity set; the candidate entity set includes the entities corresponding to each candidate position interval in the power grid fault emergency plan text to be annotated; a second prompt word recognition module, configured to combine the preset entity type to be recognized, relevant knowledge of each entity in the target entity set, and each entity in the target entity set into a second prompt word, and input the second prompt word into the large language model to obtain a second entity set; the second entity set includes all entities in the target entity set that match the preset entity type to be recognized; The final entity result determination module is used to determine that entities in the first entity set whose confidence is greater than or equal to a set threshold and all entities in the second entity set are the final entity results of the power grid fault plan text to be marked.
8. A computer device comprising: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the power grid fault plan entity identification method according to any one of claims 1 to 6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for identifying entities of a power grid fault plan according to any one of claims 1 to 6 is implemented.
10. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the method for identifying entities of a power grid fault plan according to any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Power grid fault handling plan analysis method based on neural regular expression
CN114997168A
Auxiliary retrieval method fusing knowledge graph and large language model
CN117633252A