Power industry knowledge graph construction method fused with large-scale language model
By using large-scale language models and global context prompts in the construction of the power industry knowledge graph, the problem of insufficient information extraction accuracy in traditional methods is solved, more accurate entity recognition and relationship extraction are achieved, and the semantic consistency and semantic consistency of the knowledge graph are improved. Interpretability provides more reliable support for power industry decision-making and resource optimization.
Patent Information
- Application Number
- CN202410675721.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-29
- Publication Date
- 2024-09-10
AI Technical Summary
Traditional power industry knowledge graph construction methods have problems such as low information extraction accuracy and insufficient contextual relevance, making it difficult to accurately identify entities and their relationships in complex texts.
Using a large-scale language model combined with global context and system prompts, through entity recognition, relationship extraction and resolution operations, the accuracy and semantic consistency of the knowledge graph are improved, and the representation differences of concepts are reduced.
It improves the accuracy and interpretability of knowledge graph construction, provides more reliable support for intelligent decision-making and resource optimization in the power industry, enhances text segmentation and entity association capabilities, and reduces concept representation differences.
Smart Images

Figure CN118627604A
Abstract
Description
Technical Field
[0001] The present invention relates to the field of knowledge graph construction in the electric power industry, and more specifically, to a method for constructing a knowledge graph in the electric power industry that integrates a large-scale language model. In the construction of the knowledge graph in the electric power industry, advanced language model technology is used to more comprehensively and accurately present key information and entity relationships in the electric power field through steps such as entity recognition and relationship extraction, providing strong support for decision-making and resource optimization. Background Art
[0002] In the power industry, the construction of knowledge graphs is crucial for achieving intelligent decision-making, resource optimization and allocation, etc. Traditional knowledge graph construction methods have a series of problems, including low information extraction accuracy and insufficient context relevance. For example, for complex power industry texts, traditional methods may have difficulty accurately identifying entities and capturing the complex relationships between them. Therefore, a more advanced and efficient method is urgently needed to solve these technical problems. Summary of the invention
[0003] The present invention provides an innovative method for constructing a knowledge graph for the electric power industry. It uses a large-scale language model and uses sophisticated text processing steps including entity recognition and relationship extraction to improve the accuracy and comprehensiveness of knowledge graph construction. It introduces global context and system prompts, strengthens text segmentation and entity association capabilities, and effectively solves the problem of insufficient information extraction accuracy in traditional methods. Through the digestion operation, the semantic consistency of the knowledge graph is further improved, the representation differences of concepts are reduced, and more reliable support is provided for intelligent decision-making and resource optimization in the electric power industry.
[0004] In order to solve the existing technical problems, the present invention provides a method for constructing a knowledge graph for the electric power industry integrating a large-scale language model. The specific steps are as follows:
[0005] Step 1: In the preprocessing stage, the input text is segmented by a preset segmentation technique to divide it into several shorter text blocks.
[0006] Step 2: For each segmented text block, use a large-scale language model to perform entity recognition on it to obtain the entities in each text block.
[0007] Step 3: For the text block processed in step 2, a large-scale language model is used to describe it to extract a summary of the target text.
[0008] Step 4: for the extracted abstracts, using a large-scale language model, referencing the entities obtained in step 2, identifying and listing entity mentions in the abstracts;
[0009] Step 5: For the text obtained in step 4, use a large-scale language model to extract relations, and formulate entity relations in the form of RDF triples, and finally obtain triples;
[0010] Step 6: Perform relationship / entity resolution on the power industry knowledge triples obtained in step 5. Through the aggregation of semantically similar concepts and subsequent prompt word design, different mentions of the same entity and different expressions of the same relationship are merged.
[0011] Furthermore, the splitting technique described in step 1 is specifically designed to enable each text block to provide a summary of the previous block as a global context to avoid context loss; a block is defined as a partially overlapping sliding window of the input text to reduce the possibility of separating two related entities.
[0012] Furthermore, the entity recognition method described in step 2 specifically includes: when using a large-scale language model to perform entity recognition on a text block, we design a detailed system prompt, which mainly includes three components: explanation of the entity, clear request and output detailed information.
[0013] Furthermore, the content of step 3 specifically includes: In order to focus on entity e i And to avoid using the entire text T which may only contain irrelevant statements about other entities, we extract a target text excerpt For triple extraction, this excerpt summarizes the information about e in T. i information. A smaller context than the full T is defined, which reduces the complexity of the next step of extraction and improves the reliability of large-scale language models. We design a suitable prompt that focuses on extracting abstractions of simple declarative sentences that provide information about entity e i We can connect to get
[0014] Furthermore, the content of step 4 specifically includes: new The text is about i Abstracts, in which we expect to find i Other entities that are relevant and contribute to its identity j ∈E. We want to detect which entity e is mentioned in the generated summary j , thus defining The subset E of entities mentioned in i We expect E iThe number of entities in E is significantly less than that in E. To solve this task, we use a system prompt to guide the large-scale language model to identify mentions of listed entities in a specific text, which are all provided by the user. We ask the large-scale language model to rewrite the list of entities, appending a "yes / no" answer to the end of each entry. The user prompt consists of a numbered list of all entities in E and the generated text Separate and label appropriately.
[0015] Further, the specific contents of step 5 include: We use the reduced context built in the first two steps for relationship extraction. We use system prompts to query the large-scale language model to identify the relationship between the entities listed in the text. We require that the entity relationship be represented in the form of RDF triples, using the subject and object selected from the entity list (reporting their names and IDs), and choose an expressive predicate.
[0016] Furthermore, the specific contents of step 6 include: calculating the weighted combination of label similarity, entity type similarity and description similarity between each entity or relationship pair, thereby dividing the entities or relationships into multiple groups; further dividing semantically similar but actually different entities or relationships through the designed prompt word template; providing unique labels for entities or relationships classified as the same concept to reduce the representation of concepts.
[0017] The technical solution of the present invention can produce the following beneficial technical effects:
[0018] 1. In the preprocessing stage, the present invention uses advanced text segmentation technology to provide a summary of the previous block as a global context for each text block, avoiding the loss of context information. This helps to more accurately perform entity recognition in step 2 through a large-scale language model, ensuring accurate capture of entities in the power industry text.
[0019] 2. The present invention enhances the text segmentation and entity association capabilities. In the preprocessing stage, by using partially overlapping sliding windows to define text blocks, the possibility of separating two related entities is reduced, thereby improving the text segmentation and entity association capabilities. At the same time, providing a global context enables each text block to fully consider the information of the previous block and better grasp the contextual relationship.
[0020] 3. The present invention can improve the semantic consistency of the knowledge graph. The weighted combination of label similarity, entity type similarity and description similarity is used through the relationship / entity resolution operation. This operation effectively groups entities or relationships, reduces the representation differences of concepts, and improves the semantic consistency of the knowledge graph.
[0021] 4. The present invention can reduce the representation differences of concepts. In the entity resolution stage, the designed prompt word template provides unique labels for entities or relationships classified as the same concept, reducing the representation differences of concepts. This helps to further improve the consistency of the knowledge graph, so that similar but actually different entities or relationships can be more clearly distinguished and understood.
[0022] 5. The present invention can improve the interpretability and applicability of the knowledge graph. By introducing global context and system prompts, the powerful capabilities of large-scale language models are fully utilized in each processing step. This not only improves the accuracy of knowledge graph construction, but also enhances the interpretability of the graph, making it easier for users to understand and apply the information therein, and promoting the further development of intelligent decision-making and resource optimization in the power industry. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] Figure 1 It is a schematic diagram of the overall process of the present invention. DETAILED DESCRIPTION
[0024] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in combination with the specific embodiments of the present application and the corresponding drawings. It should be emphasized that in the process of describing the present invention, various formulas and constraints are distinguished by using consistent numbers, but it does not exclude the use of different numbers to mark the same formula and / or constraint. The purpose of this setting is to more clearly illustrate the characteristics of the present invention.
[0025] like Figure 1 The figure shows a method for constructing a knowledge graph for the electric power industry integrating a large-scale language model according to the present invention, comprising the following steps:
[0026] Step 1: In the preprocessing stage, the input text is segmented by a preset segmentation technique to divide it into several shorter text blocks.
[0027] In order to overcome the limitation of large-scale language models on the number of tokens, entity and triple extraction for long texts must be performed in multiple steps to ensure that the token limit is not reached. This operation needs to solve two main problems: the global context is missed because the terms and expressions used in each independent block may lose their meaning when derived from the narrative of the entire text; and the related entities are separated because two entities belonging to a triple may be distributed in two independent blocks, resulting in the inability to recover their relationship.
[0028] In this step, we design a splitting technique to solve these two problems. Specifically:
[0029] By providing each chunk with a summary of the previous chunk as global context, we avoid context loss. We use a summary task to generate chunks i The summary of all blocks from 1 to i-1 (we call it summary i ), this summary is through chunk i and summary i-1 Calculated as input.
[0030] By defining chunks as partially overlapping sliding windows of the input text, the probability of separating two related entities is reduced. The larger the size and overlap of the chunks, the lower the probability of separating two related entities.
[0031] Step 2: For each segmented text block, use a large-scale language model to perform entity recognition on it to obtain the entities in each text block.
[0032] The entity extraction task starts with identifying entity mentions in a given block of text. To guide large-scale language models to complete this task, we use a detailed system prompt that includes the following components:
[0033] S1) Entity label: the explanation of the entity.
[0034] S2) Explicit Request: Explicitly request to retrieve entity mentions in user text, and additionally request a description and a list of types for each entity.
[0035] S3) Output details: Details specified for properly formatting the output. The text from which the entities are extracted is incorporated into the user prompt.
[0036] While S2 explains the task to be performed and S3 establishes a standard format for the output, the role and functionality of S1 may not be so intuitive. S1 is not mandatory for the performance of the task because in the context of knowledge graphs, large-scale language models already understand the meaning of entities and can find entity mentions even without these details.
[0037] However, including S1 has a significant impact: it reduces the number of entities extracted, but focuses more on concrete nouns and named entities described in detail in the text block. General and abstract nouns are mainly used as types. If S1 is excluded from the prompt, the entity descriptions are more concise.
[0038] This observed behavior leads to a positive assessment of the contribution of S1, and we maintain it in our implementation and experiments. The set of entities extracted at this stage is labeled E.
[0039] Step 3: For the text block processed in step 2, a large-scale language model is used to describe it to extract a summary of the target text.
[0040] In order to focus on the entity i And to avoid using the entire text T which may only contain irrelevant statements about other entities, we extract a target text excerpt For triple extraction, this excerpt summarizes the information about e in T. i information. A smaller context than the full T is defined, which reduces the complexity of the next step of extraction and improves the reliability of large-scale language models. We design a suitable prompt that focuses on extracting abstractions of simple declarative sentences that provide information about entity e i We can connect to get
[0041] Step 4: for the extracted abstracts, using a large-scale language model, referencing the entities obtained in step 2, identifying and listing entity mentions in the abstracts;
[0042] New The text is about i Abstracts, in which we expect to find i Other entities that are relevant and contribute to its identity j ∈E. We want to detect which entity e is mentioned in the generated summary j , thus defining The subset E of entities mentioned in i We expect E i The number of entities in E is significantly less than that in E. To solve this task, we use a system prompt to guide the large-scale language model to identify mentions of listed entities in a specific text, which are all provided by the user. We ask the large-scale language model to rewrite the list of entities, appending a "yes / no" answer to the end of each entry. The user prompt consists of a numbered list of all entities in E and the generated text Separate and label appropriately.
[0043] Step 5: For the text obtained in step 4, use a large-scale language model to extract relations, and formulate entity relations in the form of RDF triples, and finally obtain triples;
[0044] In this step, we use the reduced context built in the previous two steps for relation extraction. We query a large-scale language model using system prompts to identify relations between entities listed in the text. We ask for entity relations to be represented in the form of RDF triples, with subjects and objects selected from the list of entities (reporting their names and IDs), and an expressive predicate selected.
[0045] Step 6: By aggregating semantically similar concepts and designing subsequent prompt words, different mentions of the same entity and different expressions of the same relationship are merged.
[0046] Step 6.1: In this step, all semantically similar entities or relationships are first aggregated. This paper designs a new aggregation strategy that comprehensively analyzes the contributions of entity / relationship labels, descriptions, and entity types in the knowledge graph to calculate the similarity scores between entities or relationships. For each pair of entities or relationships (i, j), calculate:
[0047] (1) Label similarity: Levenshtein distance between two entity labels. i,j Represents the similarity between two entities, r i,j Indicates the similarity between two relations. i,j and r i,j Both are normalized to the range [0,1], where a similarity equal to 1 indicates that the entities are identical.
[0048] (2) Entity type similarity: We use the same strategy as entity and relation similarity to calculate the similarity (t i,j ). Note that entity types are only associated with entities.
[0049] (3) Description similarity: Since descriptions are more complex text fragments than entity or type labels, this paper adopts the Universal Sentence Encoder model as the embedding model, projects all entity and relationship descriptions into an embedding space, and uses cosine similarity to calculate the similarity between two descriptions i and j. i,j Represents the similarity between two entity descriptions, rd i,j Indicates the similarity between two relationship descriptions.
[0050] The final similarity score of an entity or relationship is a weighted combination of label similarity and description similarity, as shown in formula (1) (2):
[0051] S e (i,j)=α·e i,j +β·ed i,j #(1)
[0052] S r (i,j)=γ·e i,j +δ·rd i,j #(2)
[0053] The present invention empirically determines the values of the coefficients and selects α = 0.35, β = 0.65, γ = 0.25 and δ = 0.75. The ultimate goal of this task is to aggregate similar entities / relations. To this end, we adopt different empirical strategies for entities and predicates.
[0054] For entities, two entities i and j are considered similar if they satisfy the following conditions:
[0055] S e (i,j)≥0.9 or
[0056] 0.7 e (i,j)<0.9 and (t i,j )>0.25
[0057] For relations, two relations i and j are considered similar if they satisfy the following conditions:
[0058] S r (i,j)≥0.8
[0059] Step 6.2, after obtaining a set of aggregations about entities and relations, the present invention designs a prompt word template, requiring the large-scale language model to further divide each similar combination into subsets of conceptually equivalent entities or relations. By iteratively processing all clusters, a set of semantically equivalent entities or relations is obtained.
[0060] Step 6.3, by writing a prompt word template, provide unique labels for entities or relationships classified as the same concept, and complete the resolution of entities and relationships.
[0061] The above detailed description of the preferred specific embodiments of the present invention does not limit the present invention in any way. Any technician in the relevant technical field, without departing from the scope of the technical solution of the present invention, makes any form of equivalent replacement or modification to the technical solution and technical content disclosed in the present invention, which does not depart from the content of the technical solution of the present invention and still falls within the protection scope of the present invention.
Claims
1. A method for constructing a knowledge graph for the power industry integrating a large-scale language model. It is characterized in that The specific steps include: Step 1: In the preprocessing stage, the input text is segmented by a preset segmentation technique to divide it into several shorter text blocks; Step 2: for each segmented text block, use a large-scale language model to perform entity recognition on it to obtain the entities in each text block; Step 3, for the text block processed in step 2, using a large-scale language model to describe it, so as to extract a summary of the target text; Step 4: for the extracted abstract, using a large-scale language model, referring to the entities obtained in step 2, identifying and listing entity mentions in the abstract; Step 5, extracting relations from the text obtained in step 4 using a large-scale language model, and formulating entity relations in the form of RDF triples, and finally obtaining triples; Step 6: For the power industry knowledge triples obtained in step 5, perform a relationship / entity resolution operation, and merge different mentions of the same entity and different expressions of the same relationship through aggregation of semantically similar concepts and subsequent prompt word design.
2. According to claim 1, a method for constructing a knowledge graph for the electric power industry integrating a large-scale language model, It is characterized in that The splitting technique in step 1 specifically provides a summary of the previous block as a global context for each text block to avoid context loss; a block is defined as a partially overlapping sliding window of the input text to reduce the possibility of separating two related entities.
3. According to claim 2, a method for constructing a knowledge graph for the electric power industry integrating a large-scale language model, It is characterized in that Each text block provides a summary of the previous block as a global context to avoid context loss. Specifically, the summary task is used to generate chunks. i The summary of all blocks from 1 to i-1 is called summary i ), the summary is through chunk i and summary i-1 Calculated as input.
4. According to claim 1, a method for constructing a knowledge graph for the electric power industry integrating a large-scale language model, It is characterized in that The content of step 2 specifically includes: when using a large-scale language model to perform entity recognition on a text block, a detailed system prompt is designed, which mainly includes three components: explanation of the entity, clear request and output detailed information.
5. According to claim 4, a method for constructing a knowledge graph for the electric power industry integrating a large-scale language model, It is characterized in that The set of entities extracted during the entity interpretation phase is labeled as E.
6. According to claim 4, a method for constructing a knowledge graph for the electric power industry integrating a large-scale language model, It is characterized in that The explicit request specifically explicitly requests the retrieval of entity mentions in the user's text, and additionally requests a description and a list of types for each entity.
7. According to claim 4, a method for constructing a knowledge graph for the electric power industry integrating a large-scale language model, It is characterized in that The output detailed information is specifically detailed information specified for correctly formatting the output, and the text from which the entity is extracted is integrated into the user's prompt.
8. According to claim 1, a method for constructing a knowledge graph for the electric power industry integrating a large-scale language model, It is characterized in that The content of step 3 specifically includes: in order to focus on entity e i And to avoid using the entire text T which may only contain irrelevant statements about other entities, the target text excerpt is extracted For triple extraction, the excerpt summarizes the information about e in T. i Information, We define a smaller context than the full T, thereby reducing the complexity of the next step of extraction and improving the reliability of large-scale language models. We design a suitable prompt that focuses on extracting the abstraction of simple declarative sentences that provide information about entity e. i information, connect them to get 9. According to claim 1, a method for constructing a knowledge graph for the electric power industry integrating a large-scale language model, It is characterized in that The content of step 4 specifically includes: new The text is about i An abstract of the type in which you would expect to find i Other entities that are relevant and contribute to its identity i ∈E, defined in The subset E of entities mentioned in i , which is convenient for detecting which entities are mentioned in the generated summary j , E is expected to i The number of entities in E is significantly less than that in E. A system prompt is used to guide the large-scale language model, asking it to identify mentions of the listed entities in a specific text. These entities are all provided by the user. The large-scale language model is used to rewrite the entity list, appending a "yes / no" answer to the end of each entry. The user prompt includes a numbered list of all entities in E and the generated text Separate and label appropriately.
10. According to claim 1, a method for constructing a knowledge graph for the electric power industry integrating a large-scale language model, It is characterized in that The content of step 5 specifically includes: performing relationship extraction using the reduced context constructed in steps 3 and 4, querying a large-scale language model using system prompts to identify the relationships between entities listed in the text, representing entity relationships in the form of RDF triples, using subjects and objects selected from the entity list (reporting their names and IDs), and selecting an expressive predicate.
11. According to claim 1, a method for constructing a knowledge graph for the electric power industry integrating a large-scale language model, It is characterized in that The step 6 specifically includes the following steps: Step 6.1: Calculate the weighted combination of label similarity, entity type similarity, and description similarity between each entity or relationship pair to divide the entities or relationships into multiple groups; Step 6.2: Further divide semantically similar but actually different entities or relations through the designed prompt word template; Step 6.3: Provide unique labels to entities or relations that are classified into the same concept to reduce the representation of the concept.
12. A method for constructing a knowledge graph for the electric power industry integrating a large-scale language model according to claim 7, It is characterized in that The specific method for calculating the label similarity between each entity or relationship pair in step 6.1 is: i,j Represents the similarity between two entities, r i,j Represents the similarity between two relations, e i,j and r i,j Both are normalized to the range [0,1], where a similarity equal to 1 indicates that the entities are identical.
13. A method for constructing a knowledge graph for the electric power industry integrating a large-scale language model according to claim 7, It is characterized in that The specific method of calculating the entity type similarity between each entity or relationship pair in step 6.1 is: the similarity (t i,j ), entity types are only associated with entities.
14. A method for constructing a knowledge graph for the electric power industry integrating a large-scale language model according to claim 7, It is characterized in that The specific method for calculating the description similarity between each entity or relationship pair in step 6.1 is: using the Universal Sentence Encoder model as the embedding model, projecting the descriptions of all entities and relationships into an embedding space, and using cosine similarity to calculate the similarity between two descriptions i and j, ed i,j Represents the similarity between two entity descriptions, rd i,j Indicates the similarity between two relationship descriptions.
Citation Information
Cited By
Industrial internet information model modeling optimization method based on natural language processing
CN119669794A
Urban planning knowledge graph construction method based on large language model
CN120031118A
Knowledge graph generation method and device, storage medium and electronic equipment
CN121365722A
Professional text-oriented weak supervision knowledge graph automatic construction method
CN121390253A
Weakly supervised knowledge graph automatic construction method for professional text
CN121390253B
