Large model-based power equipment knowledge extraction method, system, equipment and medium
By combining professionally labeled entity recognition models and data enhancement technology with large-model error correction, designing specific prompt words and rule template screening, a lightweight and large-model collaborative power equipment knowledge extraction architecture was constructed, which solved the problem of entity and relationship extraction of large models in professional fields and achieved efficient and accurate power equipment knowledge extraction.
Patent Information
- Application Number
- CN202510700317.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-28
- Publication Date
- 2025-09-05
AI Technical Summary
Existing large models have problems in entity recognition and relationship extraction in professional fields, such as high computational cost, poor deployment flexibility, and insufficient detail capture capabilities. Especially in the field of power equipment, it is difficult to achieve high-precision entity and relationship extraction.
A professionally labeled entity recognition model combined with data enhancement technology is used for entity recognition. Through format conversion and large-scale model error correction, specific prompt words are designed for relationship extraction, and rule templates are used to filter the results to build a lightweight and large-scale model-coordinated power equipment knowledge extraction architecture.
It significantly improves the accuracy of relationship classification and entity recognition in the field of power equipment, solves the problems of detail deviation and high-cost fine-tuning of large models in professional fields, and achieves deep semantic understanding and accurate extraction of professional entities with low annotation dependence.
Smart Images

Figure CN120598009A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of natural language processing, and specifically relates to a method, system, equipment and medium for extracting knowledge from power equipment based on a large model. Background Art
[0002] Knowledge graph construction is a key research direction in the field of artificial intelligence, aiming to transform unstructured or semi-structured data into structured knowledge networks to support intelligent applications. The core technologies for knowledge graph construction include entity recognition and relationship extraction. Entity recognition uses natural language processing techniques to detect and classify key elements (such as parameters and parameter values) from text, while relationship extraction further analyzes the semantic associations between entities (such as "has," "greater than," and "less than"). Together, these two construct the nodes and edges of the knowledge graph. Traditional methods rely on rule templates and statistical models. With the advancement of deep learning, joint extraction methods based on pre-trained language models (such as BERT) have emerged, significantly improving entity and relationship recognition. However, addressing data sparsity, semantic complexity, and extraction accuracy remain challenges.
[0003] Large models, particularly large pre-trained language models (such as BERT and the GPT series), have been a significant advancement in the field of natural language processing (NLP) in recent years. These models, based on deep learning architectures, typically have hundreds of millions or even billions of parameters. Through unsupervised or weakly supervised pre-training on large-scale text datasets, they learn rich linguistic features and patterns. Large models are capable of performing a variety of NLP tasks, including but not limited to text generation, question-answering systems, semantic understanding, and sentiment analysis, without requiring extensive training on specific data for each task. The powerful generalization capabilities of these models enable them to achieve excellent performance on new tasks with minimal fine-tuning or direct use.
[0004] Large models offer powerful natural language processing capabilities, but they also present inherent challenges, particularly the problem of "hallucinations," where seemingly plausible but actually false or inaccurate information is generated. This is because large models often make predictions based on correlations rather than causation. While they can identify relevant patterns between things, they lack an understanding of causal chains and logical inferences, potentially leading to answers that are neither logical nor realistic.
[0005] Retrieval-augmented generation (RAG) can significantly improve the quality and usefulness of large language models (LLMs) and address the problem of model hallucinations. This technology is a key component of most LLM-based tools, and most RAG methods use vector similarity as a search technique. For example, Microsoft's GraphRAG uses LLM to generate a knowledge graph, significantly improving question-answering performance when analyzing complex documents. GraphRAG's core process involves using a large model to extract entities and their relationships from source documents to construct a knowledge graph. Its prompts typically include a list of entity types, entity descriptions, and instantiation examples. However, when processing specialized text such as equipment failure cases and technical standards, the need to extract specific entities such as equipment, components, and parameters presents challenges such as complex annotation specifications and the difficulty of accurately describing the annotation logic in natural language. General-purpose large models lack entity recognition capabilities for specialized text. For example, in the phrase "high-voltage leads, end-screen grounding wires, etc. are connected normally," the large model recognizes "high-voltage leads, end-screen grounding wires, etc. connections" as a parameter, while also including component entities such as "high-voltage leads" and "end-screen grounding wires," resulting in insufficiently refined recognition. If the prompt word is set too long according to the standard specification, it will exceed the context processing capabilities of the large model, and the entity recognition accuracy will not provide a significant hint. This limitation makes the existing general prompt word system difficult to adapt to the high-precision extraction requirements of professional fields.
[0006] Currently, fine-tuning all parameters of large models in professional fields is limited by high computational costs, low deployment flexibility, and insufficient ability to capture professional details. In contrast, entity recognition, as a low-level semantic feature extraction task, is easy to construct training data, and when the annotation specifications are clear, high-precision extraction effects can be achieved through lightweight models. However, relationship extraction requires the establishment of semantic associations between entity pairs, which involves a deep understanding of contextual logic and domain knowledge. Traditional methods based on rule templates or remote supervision have problems such as weak generalization ability and sensitivity to annotation noise. Although end-to-end neural network models have improved adaptability, they are still limited by the sparsity of training data and the complexity of relational semantics. It is still difficult to achieve stable and reliable extraction effects, resulting in their effects being significantly weaker than entity recognition tasks. Current technical bottlenecks restrict the refined application of knowledge graphs in vertical fields such as power equipment. In addition, existing relationship extraction datasets generally lack explicit annotations of entity locations, resulting in the inability to accurately associate the same surface entities (such as values, terms) that appear multiple times in the same text with the corresponding context. For example, in "The voltage should be less than 5V when the temperature is 5 degrees Celsius", the parameter entity "5" belongs to the voltage threshold and temperature conditions respectively, but due to the lack of position marks (such as character offsets or dependency paths), the model may easily mistakenly map the two "5"s as repeated occurrences of the same entity or confuse their relationships. Summary of the Invention
[0007] The purpose of the present invention is to address the problems in the above-mentioned prior art and provide a method, system, equipment and medium for extracting knowledge from power equipment based on a large model, which significantly improves the accuracy of complex relationship type recognition, while avoiding the detail deviation of the large model in the extraction of professional entities. Through task decoupling and result cascade strategies, while reducing the high-cost fine-tuning of the large model, it achieves a dual breakthrough in deep semantic understanding and accurate extraction of professional entities under low annotation dependence.
[0008] In order to achieve the above object, the present invention has the following technical solutions:
[0009] In a first aspect, a method for extracting knowledge from power equipment based on a large model is provided, comprising:
[0010] The input original text is used to identify entities using a professionally annotated entity recognition model and data enhancement methods;
[0011] Perform format conversion on the entity recognition results, and construct a mapping set to map the replaced format to the original entity name, so that the output format of the entity recognition results is converted into text containing placeholders and the corresponding entity mapping table;
[0012] Correct the incorrect labeling results of entity recognition results through a large model;
[0013] Based on the entity recognition results after output format conversion and correction of incorrect annotation results, a large model system prompt word for relationship extraction is designed, and the output results of the large model are obtained by inputting the text to be processed;
[0014] Check the output results of the large model, filter out the results that meet the requirements, and complete the extraction of power equipment knowledge.
[0015] As a preferred solution, in the step of using a professionally annotated entity recognition model to input the original text and adopting a data enhancement method to perform entity recognition, the bottom layer of the professionally annotated entity recognition model is a word vector input layer, and the word vector input layer provides semantic association weights and parameter vectors for the input words through a pre-trained model of text in the electric power field; the pre-trained model of text in the electric power field injects electric power text corpus on the basis of a Transformer-based bidirectional encoder representation BERT, and performs secondary pre-training through a dynamic masking strategy and a domain-adapted masking mechanism to achieve a deep fusion of the semantic space of the electric power field and the general language representation; the neural unit in the middle layer adopts a combined bidirectional long short-term memory network BiLSTM, so that the entity boundaries are segmented according to contextual information; the upper layer is a conditional random field CRF, which reduces the transfer error probability of the temporal label by adding domain text features.
[0016] As a preferred solution, the input original text is used to use a professionally annotated entity recognition model, and in the step of entity recognition using a data enhancement method, the data enhancement method generates additional training samples on the basis of the original data set to assist the model in learning the diversity of entity features, thereby improving the model's adaptability to different expressions, including: for text entities, pre-labeling entities in some samples, marking the entity type and the position of the entity in the text sentence, sorting out all entity names of each entity type, and replacing the entities according to the annotated position in the sentence; for entities containing numbers, using a template generation method to perform entity enhancement, and the characters after the number replacement can cover the numbers 0-9, decimal points and symbols before the numbers; and performing common number judgment, with an 80% probability for generating common numbers and a 20% probability for generating uncommon numbers; so that the generated numerical entities cover all numerical entities in the text as much as possible, and then replacing the entities according to the annotated position in the sentence.
[0017] As a preferred solution, in the step of using a professionally annotated entity recognition model to input the original text and adopting a data enhancement method to perform entity recognition, the entity recognition result is output using an initial-intermediate-external BIO annotation system.
[0018] As a preferred solution, in the step of converting the format of the entity recognition result and constructing a mapping set to map the replaced format to the original entity name, so that the output format of the entity recognition result is converted into a text containing placeholders and a corresponding entity mapping table, the entity recognition result is formatted using the "[entity type: entity serial number]" method. The entity serial numbers in the same sentence are not repeated, and are numbered sequentially from left to right starting from 1 according to the entities.
[0019] As a preferred solution, in the step of correcting the incorrectly labeled results of the entity recognition results through a large model, the large model prompt words are constructed as follows: Hello, please determine whether the entity labeled below is correct, whether there are any extra or missing characters, if not, please correct it, and express it in JSON format; at the same time, give the original text of the entity annotation; obtain the modification result returned by the large model; modify the original annotation text according to the modification result of the large model, and modify the entity mapping table.
[0020] As a preferred solution, the entity recognition results after output format conversion and error labeling result correction are used to design a large model system prompt word for relationship extraction, and in the step of obtaining the large model output result by inputting the text to be processed, the identity or function that the generative large model should play in a specific interaction is clarified through role definition, helping the generative large model to understand its own tasks, target users and context environment; by setting requirements, the model output is constrained so that the generative large model can output correct results, including: (1) using JSON format array representation, each item includes a head entity head, a tail entity tail and a relationship name r; (2) the relationship name is any one of "greater than", "less than", "equal to", "greater than or equal to", "less than or equal to", "is", "is not", "has" and "does not have"; (3) the head and tail entities are entities with placeholders, the head entity is a parameter entity, and the tail entity is a parameter value entity.
[0021] As a preferred solution, in the step of checking the output results of the large model, screening out results that meet the requirements, and completing the power equipment knowledge extraction, the method of using rule templates to check the output results of the large model and screen out results that meet the requirements includes:
[0022] The head entity is the parameter entity, and the tail entity is the parameter value entity;
[0023] The relationship name is any one of "greater than", "less than", "equal to", "greater than or equal to", "less than or equal to", "is", "is not", "has" and "does not have";
[0024] When the entity boundary contains non-core information, truncation is performed;
[0025] The head and tail entities need to exist in the entity mapping table;
[0026] The output result format of the large model is converted into the format of a common data set for evaluating the output result of the large model.
[0027] In a second aspect, a large-model-based power equipment knowledge extraction system is provided, comprising:
[0028] The entity recognition module is used to use the professionally annotated entity recognition model to perform entity recognition using data enhancement methods on the input raw text;
[0029] The format conversion module is used to convert the format of the entity recognition results and build a mapping set to map the replaced format to the original entity name, so that the output format of the entity recognition result is converted into a text containing placeholders and a corresponding entity mapping table;
[0030] Large model error correction module, used to correct incorrect labeling results of entity recognition results through a large model;
[0031] The large-model relationship extraction module is used to design large-model system prompt words for relationship extraction based on the entity recognition results after output format conversion and correction of incorrect annotation results, and obtain the large-model output results by inputting the text to be processed;
[0032] The result screening module is used to check the output results of the large model, filter out the results that meet the requirements, and complete the extraction of power equipment knowledge.
[0033] As a preferred solution, the entity recognition module uses a professionally annotated entity recognition model to input the original text. When the entity recognition is performed using a data enhancement method, the bottom layer of the professionally annotated entity recognition model is a word vector input layer, and the word vector input layer provides semantic association weights and parameter vectors for the input words through the power field text pre-training model; the power field text pre-training model injects power text corpus on the basis of the Transformer-based bidirectional encoder representation BERT, and performs secondary pre-training through a dynamic masking strategy and a domain-adapted masking mechanism to achieve a deep fusion of the power field semantic space and the general language representation; the neural unit in the middle layer adopts a combined bidirectional long short-term memory network BiLSTM, so that the entity is segmented according to the context information; the upper layer is a conditional random field CRF, which reduces the transfer error probability of the time series label by adding domain text features.
[0034] As a preferred solution, the entity recognition module inputs the original text and uses a professionally annotated entity recognition model. When using a data enhancement method for entity recognition, the data enhancement method generates additional training samples based on the original data set to assist the model in learning the diversity of entity features, thereby improving the model's adaptability to different expressions, including: for text entities, pre-marking entities in some samples, marking the entity type and the entity's position in the text sentence, sorting out all entity names of each entity type, and replacing the entities according to the annotated position in the sentence; for entities containing numbers, using a template generation method to perform entity enhancement, and the characters after the number replacement can cover the numbers 0-9, decimal points and symbols before the numbers; and performing common number judgment, with an 80% probability of generating common numbers and a 20% probability of generating uncommon numbers; so that the generated numerical entities cover all numerical entities in the text as much as possible, and then replacing the entities according to the annotated position in the sentence.
[0035] As a preferred solution, the entity recognition module uses a professionally annotated entity recognition model to input the original text, and when using a data enhancement method to perform entity recognition, the entity recognition result is output using an initial-middle-external BIO annotation system.
[0036] As a preferred solution, the format conversion module performs format conversion on the entity recognition results in the form of "[entity type:entity serial number]". The entity serial numbers in the same sentence are not repeated and are numbered sequentially from left to right starting from 1.
[0037] As an optimal solution, the large model error correction module constructs the large model prompt words in the following manner: Hello, please determine whether the entity marked below is correct, whether there are any extra or missing characters, if not, please correct it, and express it in JSON format; at the same time, give the original text of the entity annotation; obtain the modification result returned by the large model; modify the original annotation text according to the modification result of the large model, and modify the entity mapping table.
[0038] As a preferred solution, the large model relationship extraction module clarifies the identity or function that the generative large model should play in a specific interaction through role definition, helping the generative large model to understand its own tasks, target users and context environment; by setting requirements, the model output is constrained so that the generative large model can output correct results, including: (1) using JSON format array representation, each item includes a head entity head, a tail entity tail and a relationship name r; (2) the relationship name is any one of "greater than", "less than", "equal to", "greater than or equal to", "less than or equal to", "is", "is not", "has" and "does not have"; (3) the head and tail entities are entities with placeholders, the head entity is a parameter entity, and the tail entity is a parameter value entity.
[0039] As a preferred solution, the result screening module uses a rule template method to check the output results of the large model and screen out results that meet the requirements, including:
[0040] The head entity is the parameter entity, and the tail entity is the parameter value entity;
[0041] The relationship name is any one of "greater than", "less than", "equal to", "greater than or equal to", "less than or equal to", "is", "is not", "has" and "does not have";
[0042] When the entity boundary contains non-core information, truncation is performed;
[0043] The head and tail entities need to exist in the entity mapping table;
[0044] The output result format of the large model is converted into the format of a common data set for evaluating the output result of the large model.
[0045] In a third aspect, an electronic device is provided, comprising a processor and a memory, wherein the processor is configured to execute a computer program stored in the memory to implement the large model-based power equipment knowledge extraction method.
[0046] In a fourth aspect, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores at least one instruction, and when the at least one instruction is executed by a processor, the method for extracting knowledge from power equipment based on a large model is implemented.
[0047] Compared with the prior art, the first aspect of the present invention has at least the following beneficial effects:
[0048] By synergistically integrating the large model (LLM) with the lightweight entity recognition model, an efficient and accurate relationship extraction architecture is constructed. The deep semantic reasoning ability of the large model is used to parse the complex associations (such as logical relationships) between entities in the text, which can significantly improve the accuracy of relationship classification. At the same time, for professional domain entities, the lightweight entity recognition model performs high-precision entity boundary calibration based on the domain dictionary and structured rules, solving the entity ambiguity or detail loss problem caused by the versatility of the large model. The present invention integrates the complex semantic understanding ability of the large model with the professional advantages of the lightweight entity recognition model, achieving dual technical complementarity. In the relationship extraction link, the large model accurately captures the implicit associations between entities through contextual reasoning, significantly improving the accuracy of complex relationship type recognition. At the entity recognition level, the professional domain optimized entity recognition model relies on domain customized annotation specifications and efficient training mechanisms to effectively solve the problem of detail deviation in the extraction of professional entities such as power equipment technical parameters and equipment components by the large model. This collaborative architecture not only circumvents the high computational cost problem of fine-tuning all parameters of the large model, but also breaks through the dual limitations of the traditional relationship extraction model on the amount of labeled data and the depth of semantic understanding. The present invention solves the entity attribution problem caused by the lack of position information of labeled entities in existing relationship extraction tasks, can accurately distinguish the position attribution of entities in the text, and significantly improves the reliability of the entity relationship extraction model. Through task decoupling and result cascade strategy, while reducing the high cost of fine-tuning of large models, a dual breakthrough of deep semantic understanding and precise extraction of professional entities under low annotation dependence is achieved. In addition, for entities with the same name that appear repeatedly in the text, the format of the entity recognition results is converted, and a mapping set is constructed to map the replaced format to the original entity name, so that the output format of the entity recognition results is converted to a text containing placeholders and a corresponding entity mapping table, thereby explicitly distinguishing the semantic attribution of the same entity word in different contexts, accurately mapping entities in different positions to corresponding relationship triples, and significantly improving the reliability of the entity relationship extraction model.
[0049] It can be understood that the beneficial effects of the second to fourth aspects mentioned above can be found in the relevant description of the first aspect mentioned above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the embodiments or descriptions of the prior art. 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.
[0051] Figure 1 Overall flow chart of the method for extracting knowledge from power equipment based on a large model according to an embodiment of the present invention;
[0052] Figure 2 Schematic diagram of the entity recognition model architecture of the large-model-based power equipment knowledge extraction method according to an embodiment of the present invention;
[0053] Figure 3 A flowchart of an embodiment of the present invention for enhancing entities containing numbers using a method for extracting knowledge from power equipment based on a large model;
[0054] Figure 4 Schematic diagram of the structure of the power equipment knowledge extraction system based on a large model according to an embodiment of the present invention. DETAILED DESCRIPTION
[0055] In the following description, specific details such as specific system structures and techniques are provided for purposes of illustration rather than limitation to facilitate a thorough understanding of the embodiments of the present application. However, it will be apparent to those skilled in the art that the present application may be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to avoid obscuring the description of the present application with unnecessary detail.
[0056] See also Figure 1 The embodiment of the present invention proposes a method for extracting knowledge of power equipment based on a large model, which mainly includes:
[0057] S1. Use professionally annotated entity recognition models to perform entity recognition using data enhancement methods on the input original text.
[0058] S2. Convert the format of the entity recognition result and construct a mapping set to map the replaced format to the original entity name, so that the output format of the entity recognition result is converted into a text containing a placeholder and a corresponding entity mapping table;
[0059] S3. Correct the incorrect labeling results of entity recognition results through a large model;
[0060] S4. Based on the entity recognition results after output format conversion and correction of incorrect annotation results, a large model system prompt word for relationship extraction is designed, and the output results of the large model are obtained by inputting the text to be processed;
[0061] S5. Check the output results of the large model, filter out the results that meet the requirements, and complete the extraction of power equipment knowledge.
[0062] See also Figure 2 In one possible implementation, in the professionally labeled entity recognition model described in step S1, the bottom layer is the word vector input layer EBERT, and the large-scale power text pre-training model developed by the United Research Institute (Global Energy Internet Research Institute Co., Ltd., referred to as the United Research Institute) is used to provide semantic association weights and parameter vectors for the input words; the power field text pre-training model is injected into the power text corpus based on the Transformer-based bidirectional encoder representation BERT, and is pre-trained twice through a dynamic masking strategy and a domain-adapted masking mechanism (including equipment entity masking, technical parameter masking, and business logic fragment masking) to achieve a deep fusion of the semantic space in the power field and the general language representation; the neural unit in the middle layer adopts a combined bidirectional long short-term memory network BiLSTM to better solve the influence of the sentence context temporal feature information on the entity word boundary segmentation. On the one hand, it effectively avoids the information gradient interference of words and phrases far away from the entity on the entity boundary segmentation; on the other hand, it retains the information of words and phrases close to the entity, which is more conducive to the entity segmentation based on context information. The upper-layer conditional random field (CRF) further reduces the transfer error probability of time series labels by adding field text features such as the average sentence length and syllable characteristics in the field of power grid main equipment.
[0063] Furthermore, when performing entity recognition tasks in text, in order to improve the performance and generalization ability of the model, the embodiment of the present invention adopts data enhancement technology in the training process of the entity recognition model. Data enhancement can help the model better learn the diversity of entity features by generating additional training samples based on the original data set, thereby improving the model's adaptability to different expressions. Including: For text entities such as parameters, you can manually pre-label the entities in some samples, mark the entity type and the position of the entity in the text sentence, organize all entity names of each entity type, and replace the entities according to the marked position in the sentence. Please refer to Figure 3 For entities containing numbers such as parameter values, template generation can be used to enhance the entities. Numbers generally include integers, decimals, integers, negative numbers, etc. The characters after replacement need to cover the numbers 0-9, decimal points, and the preceding "+", "-", "±", etc. The process is as follows Figure 3As shown, the data augmentation process must ensure both numerical randomness and character coverage. Considering that the integer portion of parameter value entities is generally less than three digits, and the decimal portion is generally less than three digits, a common number determination is performed, with an 80% probability of generating common numbers and a 20% probability of generating uncommon numbers. Uncommon numbers generally have no more than eight digits, ensuring that the generated numerical entities cover all numerical entities in the text as much as possible. Entities are then replaced based on their annotated position in the sentence.
[0064] In one possible implementation, entity recognition results are output using the BIO (Begin-Inside-Outside) annotation system. For example, in "Induced voltage is less than 20V," "Induced voltage" is annotated as a device parameter entity as [B-PARAM Induction] [I-PARAM Response] [I-PARAM Electricity] [I-PARAM Pressure], and "20" is annotated as a numerical condition entity as [B-VALUE 2] [I-VALUE 0], with other characters marked as O. A complete annotation example is: Induction / B-PARAM Response / I-PARAM Electricity / I-PARAM Pressure / I-PARAM Less than / O than / O 2 / B-VALUE 0 / I-VALUE.
[0065] In one possible implementation, step S2 converts the entity recognition result into a format using the format "[entity type:entity serial number]" and constructs a mapping set to ensure that the replaced format maps to the original entity name. For example, the text "Induction voltage is less than 20V" can be converted into "[parameter:1:induction voltage] is less than [parameter value:2:20]V", with the entity mapping table: {"[parameter:1:voltage]":"induction voltage","[parameter value:2:20]":"20"}. Entity serial numbers are not repeated in the same sentence, and are numbered sequentially from left to right starting from 1.
[0066] In a possible implementation, for the above entity output results, there may be a small number of entity labeling problems, so step S3 of the embodiment of the present invention uses a large model to correct the incorrect labeling results.
[0067] The large model prompt is as follows: Hello, please check whether the entities marked below are correct, and whether there are any extra or missing characters. If not, please correct them. Use JSON format, for example: {"[parameter value-unit:34:k]":"[parameter value-unit:34:kV]"}.
[0068] At the same time, the original text of the entity annotation is given, for example, [parameter:1:induced voltage] is less than [parameter value:2:20]V.
[0069] At this time, the large model will return the result: {"[parameter:1:induced electricity]":"[parameter:1:induced voltage]"}.
[0070] According to the modification results of the large model, modify the original annotation text: "[Parameter:1: Induced voltage] is less than [Parameter value:2:20]V", and modify the entity mapping table at the same time.
[0071] In one possible implementation, step S4 designs a large model system prompt word for relationship extraction, and then inputs the text to be processed and processes it using a generative large model (such as Qwen2-72B). The system prompt word includes role definition and requirements.
[0072] Role definition: This clarifies the identity or function that the generative model should play in a specific interaction. It provides a framework for the model to understand its task, target users, and context. For example, “I can extract the relationship between entities containing parameters and parameter values from the following text.”
[0073] Requirements: refers to the constraints on the model output in order to output the correct results. They can be as follows:
[0074] (1) Expressed in JSON format array, each item includes the head entity (head), the tail entity (tail), and the relationship name (r);
[0075] (2) The relationship name is any one of “greater than,” “less than,” “equal to,” “greater than or equal to,” “less than or equal to,” “is,” “is not,” “has,” and “does not have.”
[0076] (3) The head and tail entities must be entities with placeholders, the head entity must be a parameter entity, and the tail entity must be a parameter value entity.
[0077] The following is an example of the output of a large model:
[0078]
[0079] In one possible implementation, due to the uncertainty of the large model output, step S5 requires further screening of the large model output using a rule template method. The specific screening method is as follows:
[0080] The first entity must be a parameter entity, and the last entity must be a parameter value entity.
[0081] The relation name must be any one of "greater than", "less than", "equal to", "greater than or equal to", "less than or equal to", "is", "is not", "has", and "has not".
[0082] When the entity boundary contains non-core information (such as units, redundant symbols, etc.), truncation is required. For example, "[parameter value:2:20]V" contains units at the end of the entity and needs to be processed into "[parameter value:2:20]".
[0083] The head and tail entities must exist in the mapping relationship table.
[0084] In addition, the result format can be converted into a common data set format for model result evaluation, for example: {"text":"Induced voltage is less than 20V","spo_list":[{"Combined":true,"predicate":"<","subject":"Induced voltage","subject_type":"Parameter","object":{"@value":"20"},"object_type":{"@value":"Parameter value"}}]}.
[0085] The present invention inputs text into a professionally annotated entity recognition model, and adopts a data enhancement method during the entity recognition model training process; converts the output result format of entity recognition into text containing placeholders and corresponding entity mapping tables; uses a large model to extract relationships to obtain relationships between entities; checks the output results of the large model and filters out results that meet the requirements. The present invention constructs an efficient and accurate relationship extraction architecture by synergistically integrating a large model (LLM) with a lightweight entity recognition model: the deep semantic reasoning ability of the LLM is used to parse the complex associations (such as logical relationships) between entities in the text, significantly improving the accuracy of relationship classification; at the same time, for professional domain entities, the lightweight model performs high-precision entity boundary calibration based on the domain dictionary and structured rules to solve the problem of entity ambiguity or loss of details caused by the versatility of the large model. Through task decoupling and result cascade strategies, this architecture achieves a dual breakthrough in deep semantic understanding and accurate extraction of professional entities under low annotation dependence while reducing the high cost of fine-tuning of the large model. In addition, the present invention solves the entity attribution problem caused by the lack of labeled entity location information in existing relationship extraction tasks: for entities with the same name that appear repeatedly in the text (such as the numerical value "5" in the technical parameter "5V" and the "5" in the environmental condition "5 degrees Celsius"), through entity recognition, placeholders and serial numbers are used to replace the input text, thereby explicitly distinguishing the semantic attribution of the same entity words in different contexts, and accurately mapping entities in different positions to corresponding relationship triples, significantly improving the reliability of the entity relationship extraction model.
[0086] See also Figure 4 Another embodiment of the present invention further provides a large-model-based power equipment knowledge extraction system, comprising:
[0087] Entity recognition module 401 is used to perform entity recognition on the input original text using a professionally annotated entity recognition model and a data enhancement method;
[0088] The format conversion module 402 is used to convert the format of the entity recognition result and construct a mapping set to map the replaced format to the original entity name, so that the output format of the entity recognition result is converted into a text containing a placeholder and a corresponding entity mapping table;
[0089] The large model error correction module 403 is used to correct the incorrect labeling results of the entity recognition results using the large model;
[0090] The large model relationship extraction module 404 is used to design large model system prompt words for relationship extraction based on the entity recognition results after output format conversion and error annotation results correction, and obtain the large model output results by inputting the text to be processed;
[0091] The result screening module 405 is used to check the output results of the large model, screen out the results that meet the requirements, and complete the power equipment knowledge extraction.
[0092] In one possible implementation, the entity recognition module 401 uses a professionally annotated entity recognition model to input the original text. When using a data enhancement method for entity recognition, the bottom layer of the professionally annotated entity recognition model is a word vector input layer, and the word vector input layer provides semantic association weights and parameter vectors for the input words through the power field text pre-training model; the power field text pre-training model injects power text corpus based on the Transformer-based bidirectional encoder representation BERT, and performs secondary pre-training through a dynamic masking strategy and a domain-adapted masking mechanism to achieve a deep fusion of the power field semantic space and the general language representation; the neural unit in the middle layer adopts a combined bidirectional long short-term memory network BiLSTM, so that the entity is segmented according to the context information; the upper layer is a conditional random field CRF, which reduces the transfer error probability of the time series label by adding domain text features.
[0093] In one possible embodiment, the entity recognition module 401 uses a professionally annotated entity recognition model to input the original text, and adopts a data enhancement method to perform entity recognition. The data enhancement method generates additional training samples based on the original data set to assist the model in learning the diversity of entity features, thereby improving the model's adaptability to different expressions, including: for text entities, pre-marking entities in some samples, marking the entity type and the position of the entity in the text sentence, organizing all entity names of each entity type, and replacing the entities according to the annotated position in the sentence; for entities containing numbers, using a template generation method to perform entity enhancement, and the characters after the number replacement can cover the numbers 0-9, decimal points and symbols before the numbers; and, performing common number judgment, with an 80% probability of generating common numbers and a 20% probability of generating uncommon numbers; so that the generated numerical entities cover all numerical entities in the text as much as possible, and then replacing the entities according to the annotated position in the sentence.
[0094] In a possible implementation, the entity recognition module 401 uses a professionally annotated entity recognition model to input the original text and adopts a data enhancement method to perform entity recognition. The entity recognition result is output using a start-middle-external BIO annotation system.
[0095] In a possible implementation, the format conversion module 402 performs format conversion on the entity recognition result using the "[entity type:entity serial number]" method. The entity serial numbers in the same sentence are not repeated and are numbered sequentially starting from 1 from left to right.
[0096] In one possible implementation, the large model error correction module 403 constructs the large model prompt words in the following manner: Hello, please determine whether the entity marked below is correct, whether there are any extra or missing characters, if not, please correct it, and express it in JSON format; at the same time, give the original text of the entity annotation; obtain the modification result returned by the large model; modify the original annotation text according to the modification result of the large model, and modify the entity mapping table.
[0097] In one possible implementation, the large model relationship extraction module 404 defines roles to clarify the identity or function that the generative large model should play in a specific interaction, helping the generative large model understand its own tasks, target users, and contextual environment; by setting requirements, the model output is constrained so that the generative large model can output correct results, including: (1) using a JSON format array representation, each item includes a head entity head, a tail entity tail, and a relationship name r; (2) the relationship name is any one of "greater than", "less than", "equal to", "greater than or equal to", "less than or equal to", "is", "is not", "has", and "does not have"; (3) the head and tail entities are entities with placeholders, the head entity is a parameter entity, and the tail entity is a parameter value entity.
[0098] In one possible implementation, the result screening module 405 uses a rule template method to check the output results of the large model and screen out results that meet the requirements, including:
[0099] The head entity is the parameter entity, and the tail entity is the parameter value entity;
[0100] The relationship name is any one of "greater than", "less than", "equal to", "greater than or equal to", "less than or equal to", "is", "is not", "has" and "does not have";
[0101] When the entity boundary contains non-core information, truncation is performed;
[0102] The head and tail entities need to exist in the entity mapping table;
[0103] The output result format of the large model is converted into the format of a common data set for evaluating the output result of the large model.
[0104] Another embodiment of the present invention further provides an electronic device, including a processor and a memory, wherein the processor is configured to execute a computer program stored in the memory to implement the large model-based power equipment knowledge extraction method.
[0105] Another embodiment of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores at least one instruction, and when the at least one instruction is executed by a processor, the method for extracting knowledge from power equipment based on a large model is implemented.
[0106] The computer program includes computer program code, which may be in source code form, object code form, executable file or some intermediate form. The computer-readable storage medium may include: any entity or device, medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory, random access memory, electric carrier signal, telecommunication signal and software distribution medium that can carry the computer program code. It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals. For ease of explanation, the above content only shows the part related to the embodiment of the present invention. For specific technical details not disclosed, please refer to the method part of the embodiment of the present invention. The computer-readable storage medium is non-transitory and can be stored in a storage device formed by various electronic devices, and can implement the execution process recorded in the method of the embodiment of the present invention.
[0107] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Thus, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0108] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems) and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowcharts and / or block diagrams, as well as combinations of processes and / or blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowcharts and / or block diagrams. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0109] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.
[0110] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0111] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit it. Although the present invention has been described in detail with reference to the above embodiments, ordinary technicians in the field should understand that the specific implementation methods of the present invention can still be modified or replaced by equivalents. Any modification or equivalent replacement that does not depart from the spirit and scope of the present invention should be covered by the scope of protection of the claims of the present invention.
Claims
1. A method for extracting knowledge from power equipment based on a large model, characterized in that: include: The input raw text is used to identify entities using a professionally annotated entity recognition model and data augmentation methods; Perform format conversion on the entity recognition results, and construct a mapping set to map the replaced format to the original entity name, so that the output format of the entity recognition results is converted into text containing placeholders and the corresponding entity mapping table; Correct the incorrect labeling results of entity recognition results through a large model; Based on the entity recognition results after output format conversion and correction of incorrect annotation results, a large model system prompt word for relationship extraction is designed, and the output results of the large model are obtained by inputting the text to be processed; Check the output results of the large model, filter out the results that meet the requirements, and complete the extraction of power equipment knowledge.
2. The method for extracting knowledge from power equipment based on a large model according to claim 1 is characterized in that: In the step of using a professionally annotated entity recognition model to input the original text and adopting a data enhancement method to perform entity recognition, the bottom layer of the professionally annotated entity recognition model is a word vector input layer, and the word vector input layer provides semantic association weights and parameter vectors for the input words through a pre-trained model of text in the electric power field; the pre-trained model of text in the electric power field injects electric power text corpus on the basis of the Transformer-based bidirectional encoder representation BERT, and performs secondary pre-training through a dynamic masking strategy and a domain-adapted masking mechanism to achieve a deep fusion of the semantic space of the electric power field and the general language representation; the neural units in the middle layer adopt a combined bidirectional long short-term memory network BiLSTM, so that the entity boundaries are segmented according to contextual information; the upper layer is a conditional random field CRF, which reduces the transfer error probability of the temporal label by adding domain text features.
3. The method for extracting knowledge from power equipment based on a large model according to claim 1 is characterized in that: In the step of inputting the original text into a professionally annotated entity recognition model and using a data enhancement method to perform entity recognition, the data enhancement method generates additional training samples based on the original data set to assist the model in learning the diversity of entity features, thereby improving the model's adaptability to different expressions, including: for text entities, pre-labeling entities in some samples, marking the entity type and the entity's position in the text sentence, organizing all entity names of each entity type, and replacing the entities according to the annotated position in the sentence; for entities containing numbers, using a template generation method to perform entity enhancement, and the characters after the number replacement can cover the numbers 0-9, decimal points and symbols before the numbers; and performing common number judgment, with an 80% probability of generating common numbers and a 20% probability of generating uncommon numbers; so that the generated numerical entities cover all numerical entities in the text as much as possible, and then replacing the entities according to the annotated position in the sentence.
4. The method for extracting knowledge from power equipment based on a large model according to claim 1 is characterized in that: In the step of inputting the original text into the entity recognition model using a professional annotation and adopting a data enhancement method to perform entity recognition, the entity recognition result is output using an initial-intermediate-external BIO annotation system.
5. The method for extracting knowledge from power equipment based on a large model according to claim 1 is characterized in that: In the step of converting the format of the entity recognition result and constructing a mapping set to map the replaced format to the original entity name, so that the output format of the entity recognition result is converted into text containing placeholders and the corresponding entity mapping table, the entity recognition result is formatted using the "[entity type:entity serial number]" method. The entity serial numbers in the same sentence are not repeated and are numbered sequentially from left to right starting from 1 according to the entities.
6. The method for extracting knowledge from power equipment based on a large model according to claim 1 is characterized in that: In the step of correcting incorrectly labeled results using a large model for the entity recognition results, the large model prompt is constructed as follows: Hello, please determine whether the labeled entity below is correct, whether there are any extra or missing characters, and if incorrect, please correct it in JSON format; at the same time, provide the original text of the entity annotation; Get the modification results returned by the large model; modify the annotation original text according to the modification results of the large model, and modify the entity mapping table.
7. The method for extracting knowledge from power equipment based on a large model according to claim 1, characterized in that: Based on the entity recognition results after output format conversion and correction of incorrect annotation results, the system prompt words of the large model for relationship extraction are designed. In the step of obtaining the output results of the large model by inputting the text to be processed, the role definition is used to clarify the identity or function that the generative large model should play in a specific interaction, helping the generative large model understand its own tasks, target users, and contextual environment; By setting requirements, the model output is constrained so that the generative large model can output correct results, including: (1) using JSON format array representation, each item includes the head entity head, the tail entity tail and the relationship name r; (2) The relationship name is any one of "greater than", "less than", "equal to", "greater than or equal to", "less than or equal to", "is", "is not", "has" and "does not have"; (3) The head and tail entities are entities with placeholders, the head entity is a parameter entity, and the tail entity is a parameter value entity.
8. The method for extracting knowledge from power equipment based on a large model according to claim 1, characterized in that: In the step of checking the output results of the large model, screening out results that meet the requirements, and completing the power equipment knowledge extraction, the method of using rule templates to check the output results of the large model and screen out results that meet the requirements includes: The head entity is the parameter entity, and the tail entity is the parameter value entity; The relationship name is any one of "greater than", "less than", "equal to", "greater than or equal to", "less than or equal to", "is", "is not", "has" and "does not have"; When the entity boundary contains non-core information, truncation is performed; The head and tail entities need to exist in the entity mapping table; The output result format of the large model is converted into the format of a common data set for evaluating the output result of the large model.
9. A large-scale model-based power equipment knowledge extraction system, characterized in that: include: The entity recognition module is used to use the professionally annotated entity recognition model to perform entity recognition using data enhancement methods on the input raw text; The format conversion module is used to convert the format of the entity recognition results and build a mapping set to map the replaced format to the original entity name, so that the output format of the entity recognition result is converted into a text containing placeholders and a corresponding entity mapping table; Large model error correction module, used to correct incorrect labeling results of entity recognition results through a large model; The large-model relationship extraction module is used to design large-model system prompt words for relationship extraction based on the entity recognition results after output format conversion and correction of incorrect annotation results, and obtain the large-model output results by inputting the text to be processed; The result screening module is used to check the output results of the large model, filter out the results that meet the requirements, and complete the extraction of power equipment knowledge.
10. The large model-based power equipment knowledge extraction system according to claim 9, characterized in that: The entity recognition module uses a professionally annotated entity recognition model to input the original text. When using a data enhancement method for entity recognition, the bottom layer of the professionally annotated entity recognition model is a word vector input layer, and the word vector input layer provides semantic association weights and parameter vectors for the input words through a pre-trained model of text in the power field; the pre-trained model of text in the power field injects power text corpus based on the Transformer-based bidirectional encoder representation BERT, and performs secondary pre-training through a dynamic masking strategy and a domain-adapted masking mechanism to achieve a deep fusion of the semantic space in the power field and the general language representation; the neural units in the middle layer use a combined bidirectional long short-term memory network BiLSTM, so that entities are segmented according to contextual information. The upper layer is a conditional random field CRF, which reduces the transfer error probability of time series labels by adding domain text features.
11. The large model-based power equipment knowledge extraction system according to claim 9, characterized in that: The entity recognition module inputs the original text and uses a professionally annotated entity recognition model. When using a data enhancement method for entity recognition, the data enhancement method generates additional training samples based on the original data set to assist the model in learning the diversity of entity features, thereby improving the model's adaptability to different expressions, including: for text entities, pre-labeling entities in some samples, marking the entity type and the entity's position in the text sentence, organizing all entity names of each entity type, and replacing the entities according to the annotated position in the sentence; for entities containing numbers, using a template generation method to perform entity enhancement, and the characters after the number replacement can cover the numbers 0-9, decimal points and symbols before the numbers; and performing common number judgment, with an 80% probability of generating common numbers and a 20% probability of generating uncommon numbers; so that the generated numerical entities cover all numerical entities in the text as much as possible, and then replace the entities according to the annotated position in the sentence.
12. The large model-based power equipment knowledge extraction system according to claim 9, characterized in that: The entity recognition module uses a professionally annotated entity recognition model to input the original text. When the data enhancement method is used for entity recognition, the entity recognition result is output using the start-middle-external BIO annotation system.
13. The large model-based power equipment knowledge extraction system according to claim 9, characterized in that: The format conversion module performs format conversion on the entity recognition results in the form of "[entity type:entity serial number]". The entity serial numbers in the same sentence are not repeated and are numbered sequentially from left to right starting from 1.
14. The large model-based power equipment knowledge extraction system according to claim 9, characterized in that: The large model error correction module constructs the large model prompt words in the following manner: Hello, please determine whether the entity marked below is correct, whether there are any extra or missing characters, if not, please correct it, and express it in JSON format; at the same time, provide the original text of the entity annotation; Get the modification results returned by the large model; modify the annotation original text according to the modification results of the large model, and modify the entity mapping table.
15. The large model-based power equipment knowledge extraction system according to claim 9, characterized in that: The large model relationship extraction module defines roles to clarify the identity or function that the generative large model should play in a specific interaction, helping the generative large model understand its own tasks, target users, and context. By setting requirements, the model output is constrained so that the generative large model can output correct results, including: (1) using JSON format array representation, each item includes the head entity head, the tail entity tail and the relationship name r; (2) The relationship name is any one of "greater than", "less than", "equal to", "greater than or equal to", "less than or equal to", "is", "is not", "has" and "does not have"; (3) The head and tail entities are entities with placeholders, the head entity is a parameter entity, and the tail entity is a parameter value entity.
16. The large model-based power equipment knowledge extraction system according to claim 9, characterized in that: The result screening module uses a rule template method to check the output results of the large model and screen out results that meet the requirements, including: The head entity is the parameter entity, and the tail entity is the parameter value entity; The relationship name is any one of "greater than", "less than", "equal to", "greater than or equal to", "less than or equal to", "is", "is not", "has" and "does not have"; When the entity boundary contains non-core information, truncation is performed; The head and tail entities need to exist in the entity mapping table; The output result format of the large model is converted into the format of a common data set for evaluating the output result of the large model.
17. An electronic device, characterized in that: The method comprises a processor and a memory, wherein the processor is used to execute a computer program stored in the memory to implement the large model-based power equipment knowledge extraction method as claimed in any one of claims 1 to 8.
18. A computer-readable storage medium, characterized in that The computer-readable storage medium stores at least one instruction, and when the at least one instruction is executed by a processor, the method for extracting knowledge of electric power equipment based on a large model as claimed in any one of claims 1 to 8 is implemented.