Power grid fault plan entity identification method, device, equipment, medium and product
By using large language models and professional grid plan dictionary knowledge base, the problem of low recognition accuracy in small samples is solved in traditional deep learning models, and high accuracy and reliability of grid fault plan entity recognition is achieved.
Patent Information
- Application Number
- CN202411820092.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-11
- Publication Date
- 2025-03-21
- Estimated Expiration
- 2044-12-11
AI Technical Summary
Traditional deep learning models perform poorly in small samples, and have limited recognition accuracy under long terms, abbreviations and complex grammars in the power grid field, resulting in low accuracy and reliability of entity recognition of grid fault plan entities.
The large language model is used for entity recognition, and the semantic similarity of the text of the small sample grid fault plan is calculated, candidate location intervals are constructed, and the recognition results are optimized in combination with the professional dictionary knowledge base of the power grid plan.
It improves the accuracy and reliability of the identification of grid fault plan entities, especially in small sample scenarios, which can effectively identify key entities in the power grid field.
Smart Images

Figure CN119670754A_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 accelerates, the stability, security and management efficiency of power grid systems become increasingly important. Grid dispatching, maintenance and fault handling play a key role in the smooth operation of the power grid industry, especially in emergencies such as power grid failures, which require rapid response to ensure the continuity and security of power grid supply. In order to achieve intelligent control and automated maintenance, the demand for data utilization and text analysis of power grid systems has become increasingly obvious. In this process, the power grid industry has accumulated a large number of plan texts and fault reports, which contain key field information such as fault type, equipment information, fault cause and disposal measures. Automatic extraction of these key information will help realize data-driven analysis and intelligent decision-making for power grid operation and maintenance.
[0003] Although the power grid industry has a large amount of text data, traditional named entity recognition methods have obvious shortcomings when processing these power grid emergency plan texts. General deep learning models perform well under the conditions of large amounts of labeled data training, but the power grid industry has a high degree of professional knowledge requirements and data samples are highly specialized, resulting in high-quality, fully labeled training data being difficult to obtain on a large scale. In addition, traditional named entity recognition methods have limited recognition accuracy in small sample scenarios, especially when faced with long terms, abbreviations, and complex grammar unique to the power grid field. The recognition accuracy of traditional named entity recognition methods often cannot meet the needs.
[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 lead to low accuracy and reliability in entity recognition of power grid fault plans. 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 entity identification in power grid fault plans.
[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 marked 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 first 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 marked that meet the preset entity type to be identified;
[0010] Constructing a plurality of candidate position 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 plan professional dictionary knowledge base, the relevant knowledge of each entity in the target entity set is obtained; 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;
[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 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 marked.
[0014] Optionally, 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:
[0015] For any power grid fault plan text in the small sample power grid fault plan set, use the pre-trained sentence vector model to process 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, and 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 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 according to the starting position and the ending position in the text of the power grid fault plan to be marked of each entity whose confidence level is less than a set threshold in the first entity set 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] The first interval is constructed by taking the minimum position as the left endpoint of the first interval and taking 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, take the i-th integer value as the left endpoint and all values in the integer value set as the right endpoints 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] Let the value of i be increased 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, determine whether the entity exists in the power grid plan professional dictionary knowledge base to obtain a first determination result;
[0025] If the first judgment result is yes, then the relevant knowledge of the entity is obtained according to the category of the entity in the power grid plan professional dictionary knowledge base.
[0026] Optionally, 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 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, according to the category of the entity in the power grid plan professional dictionary knowledge base, the relevant knowledge of the entity is obtained, specifically including:
[0029] If the category of the entity in the power grid plan professional dictionary knowledge base is an abbreviation, 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 synonym 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 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 a 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] The first prompt word recognition module is used to form a first prompt word by combining the preset entity type to be identified, the target power grid fault plan text set and the power grid fault plan text to be marked, and input it into the 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 first 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 marked that meet the preset entity type to be identified;
[0035] A candidate position interval determination module, used to construct multiple candidate position 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 marked;
[0036] 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;
[0037] A second prompt word recognition module is used 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 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;
[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 of the above-described methods for entity identification of 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, device, equipment, medium and product for entity recognition of power grid fault plans. The large language model is pre-trained on a large amount of general corpus and has strong zero-shot and few-shot learning capabilities. The present application uses a large language model for entity recognition to solve the problem that the traditional deep learning model performs poorly in small sample situations and the generalization of different types of power grid plans is poor. In addition, by providing a small number of domain examples to the large language model and designing an effective prompting project, the present application designs a recognition framework of "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 the candidate position interval, obtain the relevant knowledge of each entity in the target entity set, construct the second prompt word, and input it into the large language model and obtain 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, the 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 drawings required for use in the embodiments will be briefly introduced below. 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 paying 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 the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0048] In order to make the above-mentioned objects, 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 power grid fault plan text set and the power grid fault plan text to be marked are combined into a first prompt word, and 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 first 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 marked that meet 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 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; classify and store the entities in the power grid plan professional dictionary knowledge base; 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, the 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 the entities in the first entity set whose confidence is greater than or equal to the set threshold and all entities in the second entity set as the 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 entity recognition in power grid fault plans.
[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 train 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 a 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] 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 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 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 following step is further included:
[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 , and normalize it:
[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. 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 power grid fault plan texts corresponding to the maximum similarity scores as the final recall examples. 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 marked are combined into a first prompt word, specifically:
[0068] Input preparation: Using the target power grid fault plan text set S selected , which is concatenated 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 used for splicing 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") at 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 text of the power grid fault plan to be marked at the sentence 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 constructing of multiple candidate position intervals based on 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 text of the power grid fault plan 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 endpoints 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] Let the value of i be increased 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 target entity set 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, it is considered that the candidate location interval corresponding to the entity is 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 removed.
[0088] In an exemplary embodiment, for each entity in the target entity set, the entity type is reallocated to each candidate position interval by combining relevant knowledge with the reasoning ability of the large language model. This application designs prompt words to guide the model to efficiently complete this task, and 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 form a second prompt word, 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") at 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] Through the above second prompt word, the model generates inference results on each entity in the target entity set, and assigns the most suitable entity type to it in combination with the description of the entity type. This process ensures that the recognition results are further optimized through expansion and verification, improving the accuracy and reliability of the overall recognition.
[0097] In an exemplary embodiment, 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 method includes:
[0098] The professional terms extracted from the power grid texts are stored in three categories: abbreviations, synonyms, and proper noun explanations, and the power grid plan professional dictionary knowledge base is obtained. Specifically, professional terms are extracted from various power grid texts such as power grid standard documents, equipment maintenance standards, and fault handling records. The collected terms are classified and sorted into three categories: abbreviations, synonyms, and proper noun explanations by experts in the power grid field, and a power grid plan professional dictionary knowledge base KB is constructed for verifying and expanding low-confidence entity candidates.
[0099] In an exemplary embodiment, according to the category of the entity in the power grid plan professional dictionary knowledge base, the relevant knowledge of the entity is obtained, which 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 noun explanation of the entity.
[0103] This application has significant technical advantages in entity identification of power grid fault emergency plans, which are specifically manifested in the following aspects:
[0104] Adapt to small sample scenarios: Traditional deep learning models require a large amount of labeled data to achieve good results, and different types of plans need to be re-labeled and trained, which is time-consuming and laborious. In contrast, this application uses the zero-shot and few-shot learning capabilities of large language models to achieve efficient and accurate entity recognition even when there is limited labeled data, greatly saving costs 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 position intervals, obtain relevant knowledge of each entity in the target entity set, construct the second prompt word, and 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 position interval expansion and knowledge base verification, misjudgment is effectively reduced to ensure 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 embodiment of the present application also provides a power grid fault plan entity identification device for implementing the power grid fault plan entity identification method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more power grid fault plan entity identification device embodiments provided below can refer to the limitations of the power grid fault plan entity identification method above, 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 entities of a preset entity type to be identified.
[0110] The first prompt word recognition module is used to form a first prompt word with the preset entity type to be identified, the target power grid fault plan text set and the power grid fault plan text to be marked, and input it into the 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 first 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 marked that meet the preset entity type to be identified.
[0111] The candidate position interval determination module is used to construct multiple candidate position 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 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, referred to as I / O) and a communication interface. Among them, the processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, 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 the 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 only a block diagram of a part 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. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components. In an exemplary embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, 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, and when the computer program is executed by a processor, the above-mentioned method embodiments are implemented.
[0118] In an exemplary embodiment, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the above-mentioned 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 of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed 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 the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile 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 may be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).
[0122] The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. The non-relational database may include a distributed database based on blockchain, etc., but is not limited thereto. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but is not limited thereto.
[0123] The technical features of the above embodiments may 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 article uses specific examples to illustrate the principles and implementation methods of this application. The description of the above embodiments is only used to help understand the method and core ideas of this application. At the same time, for those skilled in the art, according to the ideas of this application, there will 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 comprises: 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 marked 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 first 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 marked that meet the preset entity type to be identified; Constructing a plurality of candidate position 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 plan professional dictionary knowledge base, the relevant knowledge of each entity in the target entity set is obtained; 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; 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; 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 marked.
2. The method for identifying entities in a power grid fault plan according to claim 1, characterized in that: The 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: For any power grid fault plan text in the small sample power grid fault plan set, use the pre-trained sentence vector model to process 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, and 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 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 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 text of the power grid fault plan 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; The first interval is constructed by taking the minimum position as the left endpoint of the first interval and taking 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, take the i-th integer value as the left endpoint and all values in the integer value set as the right endpoints 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; Let the value of i be increased 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 of power grid fault emergency plans 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 plan professional dictionary knowledge base specifically includes: For any entity in the candidate entity set, determine whether the entity exists in the power grid plan professional dictionary knowledge base to obtain a first determination result; If the first judgment result is yes, then the relevant knowledge of the entity is obtained according to the category of the entity in the power grid plan professional dictionary knowledge base.
5. The method for identifying entities of power grid fault emergency plans 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 of power grid fault emergency plans 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, including: If the category of the entity in the power grid plan professional dictionary knowledge base is an abbreviation, 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 synonym 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 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 comprises: A semantic similarity calculation module is used to respectively calculate the semantic similarity between each power grid fault plan text in a 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; The first prompt word recognition module is used to form a first prompt word by combining the preset entity type to be identified, the target power grid fault plan text set and the power grid fault plan text to be marked, and input it into the 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 first 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 marked that meet the preset entity type to be identified; A candidate position interval determination module, used to construct multiple candidate position 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 marked; 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; A second prompt word recognition module is used 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 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; 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 entity identification method for a power grid fault plan 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 in power grid fault plans described in 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 power grid fault plans described in 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
Small sample-oriented power grid fault plan entity identification method and system
CN118095281A
Medical named entity identification method and device based on large language model
CN118114675A
Cited By
Poem entity extraction model training method, poem entity extraction method and poem entity extraction equipment
CN120277219A
Training method for poetry entity extraction model, poetry entity extraction method and device
CN120277219B