Carbon inspection domain knowledge graph construction method and system based on prompt engineering

CN122072837APending Publication Date: 2026-05-22STATE GRID SHANGHAI MUNICIPAL ELECTRIC POWER CO +1
View PDF 5 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
STATE GRID SHANGHAI MUNICIPAL ELECTRIC POWER CO
Filing Date
2026-04-22
Publication Date
2026-05-22

AI Technical Summary

Technical Problem

Existing technologies lack an integrated knowledge graph construction system in the field of carbon verification, which presents challenges such as low-resource construction, low knowledge extraction accuracy, high difficulty in graph construction, poor system adaptability, and general methods that cannot be directly adapted to the complexity and dynamic changes in the field of carbon verification.

Method used

By constructing a dedicated basic resource library and hierarchical prompt template library for the carbon verification field, combined with a dynamic prompt generation strategy that enhances retrieval, and utilizing a general large language model to extract knowledge under zero-sample or few-sample conditions, a high-quality knowledge graph is constructed.

Benefits of technology

It enables rapid adaptation to the carbon verification field under zero or few sample conditions, constructs a high-quality knowledge graph, improves the accuracy and recall rate of knowledge retrieval, and enhances the system's service capabilities for actual carbon verification work.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122072837A_ABST
    Figure CN122072837A_ABST
Patent Text Reader

Abstract

The invention relates to a carbon check domain knowledge graph construction method and system based on prompt engineering, and the method comprises the steps: obtaining a multi-source unstructured text including an enterprise carbon emission report, an industry check guide and a carbon accounting standard file, and carrying out the preprocessing, and obtaining a to-be-processed text fragment set; calculating the similarity between every two to-be-processed text fragments in the to-be-processed text fragment set to obtain an independent text fragment set; then semantic analysis is carried out, and theme keywords and corresponding weights are generated; carrying out keyword matching retrieval and semantic similarity calculation, and calculating comprehensive retrieval similarity; based on the comprehensive retrieval similarity, generating an enhanced cue word; based on the enhanced cue word, performing knowledge extraction on the text fragment to obtain a structured knowledge result and performing quality optimization; and based on the optimized knowledge result, constructing a carbon inspection domain knowledge graph. Compared with the prior art, the method has the advantage of high knowledge extraction precision.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of carbon verification technology, and in particular to a method and system for constructing a knowledge graph in the field of carbon verification based on prompting engineering. Background Technology

[0002] Currently, knowledge graph construction technology has formed a relatively mature technical system in general fields, but its application in the field of carbon verification faces many problems. General knowledge graph construction methods rely on sufficient labeled data for model training and optimization. However, the carbon verification field has problems such as the complexity and dynamic updates of carbon accounting standards (such as ISO 14064 and GHG Protocol), significant differences in emission source types and accounting methods across different industries, and inconsistent unstructured text formats such as corporate carbon emission reports. Collecting and labeling training data covering all scenarios and industries is extremely costly and even difficult to achieve, forming a typical "low-resource" application dilemma. General methods cannot be directly adapted to the needs of the carbon verification field.

[0003] Some domain-adaptive knowledge graph construction methods attempt to achieve domain adaptation through model fine-tuning. However, this approach requires a certain scale of labeled data, suffers from high training costs, and is easily affected by data distribution, making it difficult to cope with the dynamic changes in rules in the carbon verification field. While general-purpose large language models possess powerful natural language understanding and generation capabilities, when directly applied to the carbon verification field, they exhibit significant domain adaptability issues, insufficient disambiguation capabilities for specialized terminology, and are prone to generating false information that is not mentioned. Furthermore, the accuracy and consistency of knowledge extraction cannot meet the professional requirements of carbon verification work.

[0004] Furthermore, existing technologies have not yet formed an integrated knowledge graph construction system for the carbon verification field. They lack a domain-customized knowledge support system and prompting engineering system. The knowledge extraction, quality verification, and graph construction are separated from each other. The entire process from unstructured text to high-quality knowledge graph has not been closed, resulting in a low degree of fit between the constructed knowledge graph and the professional rules of carbon accounting, making it difficult to directly serve the actual work of carbon verification.

[0005] The invention disclosed in CN116383414A presents a method and system for constructing a knowledge graph in the field of carbon verification based on prompting engineering. The system includes: a text data acquisition module for acquiring dual-carbon text data during the carbon verification stage; a knowledge graph construction module for establishing a carbon verification knowledge graph based on the dual-carbon text data; and a review module for acquiring carbon audit reports to be reviewed and conducting document review based on the carbon verification knowledge graph. Compared with existing technologies, this invention collects text data related to regulations, policies, standards, and corporate carbon audit reports from the carbon verification workflow, extracts relevant entities and relationships during the carbon verification process, and constructs a dual-carbon knowledge graph oriented towards carbon verification through knowledge reasoning. Based on the knowledge graph, relevant entities and their data are extracted sequentially from various texts. The completeness, consistency, and accuracy of the data in corporate carbon emission reports are verified according to the definition of carbon emission scope, emission source type, selection of emission factors, and carbon emission calculation formula. However, the system designed in this scheme has poor automation and low knowledge extraction accuracy.

[0006] Therefore, there is an urgent need to design a low-resource knowledge graph construction method and system that can quickly adapt to the characteristics of the carbon verification field without requiring large-scale labeled data and model retraining, in order to solve the problems of low knowledge extraction accuracy, high difficulty in graph construction, and poor system adaptability in the current field. Summary of the Invention

[0007] The purpose of this invention is to overcome the shortcomings of the existing technology by providing a method and system for constructing a knowledge graph in the field of carbon verification based on prompting engineering. By constructing a basic resource library and a hierarchical prompting template library specifically for the field of carbon verification, and combining a dynamic prompting generation strategy with enhanced retrieval, a general large language model is called to complete the extraction of knowledge in the field of carbon verification under zero-sample or few-sample conditions. After quality optimization, a high-quality knowledge graph is constructed and dynamically updated.

[0008] The objective of this invention can be achieved through the following technical solutions: A method for constructing a knowledge graph in the field of carbon verification based on prompting engineering includes: Acquire unstructured text from multiple sources, including corporate carbon emission reports, industry verification guidelines, and carbon accounting standard documents, and preprocess it to obtain a set of text fragments to be processed; Calculate the similarity between any two text segments in the set of text segments to be processed. If the similarity is higher than a preset similarity threshold, they are grouped into one segment; if the similarity is lower than the threshold, they are grouped into two segments, resulting in an independent set of text segments. Semantic analysis is performed on each text fragment in the set of independent text fragments to generate topic keywords and corresponding weights; based on the topic keywords and corresponding weights, keyword matching retrieval and semantic similarity calculation are performed in a pre-constructed knowledge base to obtain keyword matching similarity and semantic similarity; based on the keyword matching similarity and semantic similarity, a comprehensive retrieval similarity is calculated; Based on preset format and rule constraints, subtask logic and domain knowledge, and the comprehensive retrieval similarity, enhanced prompt words are generated; based on the enhanced prompt words, knowledge is extracted from the text fragments in the set of independent text fragments to obtain structured knowledge results and perform quality optimization; based on the quality-optimized knowledge results, a carbon verification domain knowledge graph is constructed.

[0009] Furthermore, semantic analysis is performed on the text fragment to be processed to obtain topic keywords and their corresponding weights. The formula for calculating the weights is as follows: in, Let be the weight of the j-th keyword in the i-th text segment. For word frequency, The number of times keyword j appears in text segment i. Inverse document frequency, The total number of documents in the basic resource library. The number of documents containing the keyword j. This represents the number of times keyword j appears in text segment k.

[0010] Furthermore, based on the keyword matching similarity and semantic similarity, a comprehensive retrieval similarity is calculated, and the corresponding calculation formula is as follows: in, These are the weighting coefficients. For keyword matching similarity, For semantic similarity, Let represent the i-th text segment to be processed, and k represent a candidate contextual knowledge in the knowledge base.

[0011] Furthermore, the knowledge extraction process specifically includes: First, disambiguation similarity is calculated based on the enhanced prompt words, and then disambiguation is performed on the text segments in the set of independent text segments; the formula for calculating the disambiguation similarity is: in, For the entity to be identified, For standard entities, For terminology similarity, For contextual similarity; Based on the enhanced prompt words, entity relations and entity attributes are extracted from the unambiguous text fragments; the extracted entity relations and entity attributes are combined to obtain the structured knowledge results.

[0012] Furthermore, the cosine similarity method is used to calculate the similarity between the text segments in the set of text segments to be processed. The corresponding calculation formula and judgment rule are as follows: Where α is a dynamically set threshold. This is the set of sentence similarities in the current document. The mean similarity. The standard deviation of similarity To adjust the coefficient, Given the word vectors of the two sentences, Here is the formula for calculating similarity. The similarity determination rules are as follows.

[0013] Furthermore, the process of optimizing the quality of the structured knowledge results specifically includes: The structured knowledge results are subjected to consistency assessment; any abnormal results are marked and reviewed; the knowledge results that pass the consistency assessment are used to construct the knowledge graph for the carbon verification field; the formula for consistency assessment is: in, Represents relational logical rules and constraints. This indicates unit matching rule constraints. This represents a constraint based on attribute consistency rules. , For structured knowledge results, This is the determination formula.

[0014] Furthermore, the format and rule constraints are obtained from the pre-built meta-hint layer to solidify the structured format specifications of the model output; the sub-task logic and domain knowledge are obtained from the pre-built task hint layer, wherein the sub-task logic and domain knowledge specifically include entity types, relationship types and attribute constraints in the carbon verification domain; based on the comprehensive retrieval similarity, standard clauses, industry standards and historical graph information are filtered in the knowledge base to obtain the domain knowledge to be imported. The enhanced prompt words are obtained by combining the format and rule constraints, subtask logic and domain knowledge, and the domain knowledge to be imported.

[0015] Furthermore, the optimized knowledge result is a set of triples consisting of entities, relations, and attribute numbers; based on the set of triples, the pre-constructed carbon verification knowledge graph is expanded to obtain the carbon verification domain knowledge graph.

[0016] Furthermore, the graph density of the carbon verification domain knowledge graph is calculated to assess the structural quality of the carbon verification domain knowledge graph, and the quality assessment result is obtained. The corresponding calculation formula is as follows: in, For the number of relations, For entity number, For the knowledge graph of carbon verification field, The graph density of the knowledge graph in the field of carbon verification; Based on the quality assessment results, quality optimization is performed to obtain the optimized knowledge results.

[0017] This invention also provides a system for constructing a knowledge graph in the field of carbon verification based on prompting engineering as described above, comprising: The basic resource library module is used to store and maintain basic resource libraries, industry guide libraries, and historical map fragment libraries in the field of carbon verification. The hierarchical prompt template library module is used to store and manage pre-defined three-level prompt templates; The text preprocessing module is used to clean, standardize, and semantically segment multi-source unstructured text to obtain a set of text fragments to be processed. The retrieval enhancement module is used to perform semantic analysis, keyword matching retrieval, and semantic similarity calculation on the set of text fragments to be processed, and generate a comprehensive retrieval similarity; further, based on preset format and rule constraints, subtask logic and domain knowledge, and the comprehensive retrieval similarity, it generates enhanced prompt words; The knowledge extraction module is used to extract knowledge from the text fragments to be processed in the set of text fragments to be processed based on the enhanced prompt words, so as to obtain structured knowledge results; The knowledge graph construction module is used to optimize the quality of the structured knowledge results and construct a knowledge graph in the field of carbon verification based on the optimized knowledge results.

[0018] Compared with the prior art, the present invention has the following advantages: (1) This invention generates thematic keywords and their weights by performing deep semantic analysis on each text fragment. Based on this, a dual retrieval strategy is implemented: on the one hand, traditional keyword matching retrieval is performed, and on the other hand, deep semantic similarity calculation is performed. Finally, the two are fused to calculate a comprehensive retrieval similarity. This provides accurate knowledge positioning for subsequent prompt generation and achieves accurate contextual knowledge positioning; Compared to simple keyword-based searches, semantic-integrated retrieval methods can accurately understand the deeper intent of text fragments. Even if specific keywords do not appear in the text, the most relevant background knowledge (such as standards and guidelines) can be found through semantic similarity, significantly improving the accuracy and recall rate of knowledge retrieval; the calculated comprehensive similarity serves as the basis for selecting the highest quality and most relevant contextual knowledge. This precise knowledge localization capability ensures that the knowledge injected into the subsequent prompt template is highly relevant, which is a key prerequisite for guaranteeing the quality of knowledge extraction.

[0019] (2) This invention abandons the traditional method of requiring large-scale labeled data to fine-tune the model, and instead designs a hierarchical template library of "meta-hints-task hints-context hints". This template library is not an empty instruction, but rather directly embeds the professional terminology definitions, accounting rules and output format constraints in the carbon verification field into the template. For example, in the entity recognition task, the template will predefine the meaning of proper nouns such as "activity data", "emission factor" and "verification boundary"; in relation extraction, it will pre-set specific relation types and judgment logic such as "belongs to", "calculation basis" and "compliance verification". This fundamentally solves the problem of low resource construction caused by the strong privacy of data and the high cost of expert annotation in the carbon verification field, so that the map construction work can be started quickly.

[0020] (3) This invention is not an isolated extraction algorithm, but rather an integrated system. It covers the entire process from data acquisition and preprocessing, text deduplication, semantic analysis, intelligent retrieval based on comprehensive similarity, to core knowledge extraction, quality optimization, and finally, graph generation. By seamlessly connecting the various stages of graph construction, it forms a one-stop solution for the carbon verification field. Compared with the existing technology's piecemeal process where each stage is separate and requires a lot of manual intervention, this system can directly start from unstructured text (such as corporate reports) and automatically output high-quality knowledge graphs that conform to domain rules, greatly enhancing the system's service capabilities for actual carbon verification work. Attached Figure Description

[0021] Figure 1 This is a flowchart of a method for constructing a knowledge graph in the field of carbon verification based on prompting engineering, provided in an embodiment of the present invention. Figure 2This is a flowchart illustrating a knowledge graph construction method for a carbon verification field based on prompting engineering, provided in an embodiment of the present invention. Figure 3 This is a schematic diagram of text fragment retrieval and assembly in an embodiment of the present invention, illustrating a method for constructing a knowledge graph in the field of carbon verification based on prompting engineering. Figure 4 This is a schematic diagram illustrating the consistency check of a carbon verification knowledge graph construction method based on prompting engineering provided in an embodiment of the present invention. Figure 5 This is a simplified flowchart of a carbon verification knowledge graph construction method based on prompting engineering provided in an embodiment of the present invention.

[0022] like Figure 2 As shown in the figure, this diagram illustrates the seven execution steps of this method, which are, in order: building a basic resource library, building a hierarchical prompt template library, multi-source text preprocessing, retrieval-enhanced dynamic prompt generation, prompt-driven knowledge extraction, structured knowledge quality optimization, and knowledge graph construction and updating.

[0023] like Figure 3 As shown in the diagram, this figure illustrates the entire process of generating dynamic suggestions for enhanced retrieval. It begins with an input text fragment, then "intent understanding" extracts keywords and forms a keyword set, the "retrieval process" links the carbon accounting standard library and industry guide library for retrieval, and in the "assembly process," the retrieval knowledge is injected into the meta-suggestion layer and the task suggestion layer, and enhanced suggestions are generated through "splitting and fusion."

[0024] like Figure 4 As shown in the diagram, this illustrates the core processing flow of knowledge extraction and quality optimization. The input is "text fragment + enhanced hints". The "LLM knowledge extraction" output is the original set of triples. In the "consistency check" stage, triples that pass the check proceed to the "redundancy removal" stage, and finally, the optimized triples are output.

[0025] like Figure 5 As shown in the diagram, this illustrates the core processing chain and data relationships of the system. Starting with "text input," the data goes through the stages of "preprocessing," "retrieval enhancement," "knowledge extraction," and "quality optimization," before being output to the "knowledge graph." Detailed Implementation

[0026] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. The components of the embodiments of the present invention described and shown in the accompanying drawings can generally be arranged and designed in various different configurations.

[0027] Therefore, the following detailed description of the embodiments of the invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but merely to illustrate selected embodiments of the invention. All other embodiments obtained by those skilled in the art based on the embodiments of the invention without inventive effort are within the scope of protection of the invention.

[0028] It should be noted that similar labels and letters in the following figures indicate similar items. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures.

[0029] Example 1 like Figure 1 As shown, this embodiment provides a method for constructing a knowledge graph in the field of carbon verification based on prompting engineering. The method includes the following steps: S1: Obtain unstructured text from multiple sources, including corporate carbon emission reports, industry verification guidelines, and carbon accounting standard documents, and preprocess it to obtain a set of text fragments to be processed; S101: Constructing a basic resource database in the field of carbon verification: a01) Construct a carbon accounting standard library, systematically integrate the core clauses, professional terminology definitions, emission scope definition rules, emission factor calculation methodologies, and other contents of mainstream carbon accounting standards such as ISO 14064 and GHG Protocol, and form a standard carbon accounting rule library; a02) Construct an industry guide library, classified according to industries such as power, steel, chemical, and transportation, and include guidelines for carbon emission source identification, quantification methods, and verification processes for different industries, while retaining the general rules for carbon verification as well as the carbon emission characteristics and verification specificities of each industry; a03) Construct a historical knowledge graph fragment library to store verified carbon verification knowledge graph fragments and their corresponding text source information. Each fragment contains interconnected entity-relationship-attribute triples. (in For a collection of entities, For a set of relations, It is a set of attributes. It establishes a mapping relationship between graph fragments and original text through entity association, supports similar case retrieval and reserves an incremental update interface to ensure the dynamic accumulation of knowledge.

[0030] S102: Building a domain-specific hierarchical hint template library: Construct a domain-hierarchical prompt template library using a three-tiered structure of "meta-prompt - task prompt - context prompt". The expression is: in, To fully enhance the prompts, This is the content of the meta-hint layer. This is the content of the task prompt layer. Domain knowledge content injected into the context hint layer; b01) Building the Meta-Prompt Layer The structured format specifications and anti-illusion rules for model output are solidified, and the model output results are required to follow the preset structured format (such as JSON). Unmentioned information is uniformly marked as "not mentioned" to prevent the model from generating erroneous knowledge without textual basis. b02) Building a task prompt layer The core design templates for the knowledge graph construction of three knowledge graphs—entity recognition and disambiguation, relation extraction, and attribute filling—are introduced. The templates import professional terminology definitions, common entity types (emission sources, accounting standards, activity data, emission factors, etc.), relation types (belonging to, adopting, quantified generation, corresponding to, etc.), and attribute constraints (emission factor units, activity data statistical periods, data sources, etc.) in the field of carbon verification to guide the model to focus on relevant concepts and logic in the field of carbon verification. b03) Building a context prompt layer A standardized dynamic knowledge import interface is reserved to load domain knowledge fragments that are highly relevant to the text to be processed and retrieved from the basic resource library, so as to achieve matching between the prompt content and the text to be processed.

[0031] S2: Calculate the similarity between any two text segments in the set of text segments to be processed. If the similarity is higher than the preset similarity threshold, they are grouped into one segment; if the similarity is lower than the similarity threshold, they are grouped into two segments, resulting in an independent set of text segments. S3: Perform semantic analysis on each text fragment in the set of independent text fragments to generate topic keywords and corresponding weights; based on the topic keywords and corresponding weights, perform keyword matching retrieval and semantic similarity calculation in the pre-built knowledge base to obtain keyword matching similarity and semantic similarity; based on keyword matching similarity and semantic similarity, calculate the comprehensive retrieval similarity. Multi-source unstructured text preprocessing: The system receives multi-source unstructured text related to carbon verification, such as enterprise carbon emission reports, industry verification guidelines, and carbon accounting standard documents. It performs preprocessing to obtain a set of semantically complete and thematically focused text fragments for processing. .

[0032] c01) Text cleaning and standardization: extract the core content of original documents in different formats, remove noise information such as headers and footers, special control symbols, and repeated paragraphs, and standardize the text encoding, date format, unit of measurement, and professional terminology to ensure the readability and consistency of the text content. c02) Semantic-aware text segmentation, using a semantic similarity-based method to segment long texts, with cosine similarity between sentences calculated as follows: (in (For word vectors of two sentences) Judgment rules: Wherein, the threshold α is a dynamically set value, and its calculation formula is as follows: in, This is the set of sentence similarities in the current document. The mean similarity. The standard deviation of similarity This is for adjusting the coefficient.

[0033] Sentences with high similarity are divided into text segments to form independent text segments that are focused on a single business scenario.

[0034] S4: Based on preset format and rule constraints, subtask logic and domain knowledge, and comprehensive retrieval similarity, generate enhanced prompt words; based on the enhanced prompt words, extract knowledge from text fragments in the set of independent text fragments to obtain structured knowledge results and perform quality optimization; based on the quality-optimized knowledge results, construct a knowledge graph for the carbon verification domain.

[0035] S401: Generate dynamic enhancement suggestions for search enhancement: For each text fragment to be processed Personalized enhanced prompts are generated by combining text understanding and knowledge retrieval. This enables dynamic enhancement of prompts based on domain knowledge.

[0036] d01) Text fragment intent understanding, the text fragment to be processed The input is fed into a general-purpose large language model, which uses semantic analysis to identify the core business scenarios and specific accounting topics (such as identifying emission sources, selecting emission factors, and calculating emission amounts), generating a set of keywords that accurately represent the content of the segment, and calculating the keyword weights. in, Let be the weight of the j-th keyword in the i-th text segment. For word frequency, The number of times keyword j appears in text segment i. Inverse document frequency, The total number of documents in the basic resource library. The number of documents containing keyword j, before retaining the weight. The keywords are used as the basis for subsequent knowledge retrieval queries.

[0037] d02) Multi-source domain knowledge retrieval and filtering: Based on the identified core topic keywords, searches are conducted in the carbon accounting standard library, industry guide library, and historical spectral fragment library. The retrieval process combines keyword matching and semantic similarity calculation, and the comprehensive retrieval similarity is: in, These are the weighting coefficients. For keyword matching similarity, For semantic similarity, standard clauses, industry specifications, and historical graph information most closely related to the current text fragment are selected from massive knowledge through relevance ranking and threshold filtering. After relevance ranking and threshold filtering, the domain knowledge to be imported is determined.

[0038] d03) Hierarchical prompt dynamic assembly: Retrieved domain knowledge is injected into the context prompt layer of the hierarchical prompt template. This is combined with the format and rule constraints of the meta-prompt layer, the sub-task logic of the task prompt layer, and the domain knowledge, based on... Dynamically merge the three-layer template to generate personalized enhanced prompts. .

[0039] S402: Perform prompt-driven domain knowledge extraction for carbon verification: Guided by the professional knowledge and terminology definitions provided in the prompts, the e01 model identifies all candidate entities in the carbon verification field, including emission sources, accounting standards, activity data, and emission factors, from the text fragments, and outputs a set of entities. Disambiguation of ambiguous entities is performed, and the disambiguation similarity is: in, For the entity to be identified, For standard entities, For terminology similarity, For context similarity, At 0.8, they were determined to be the same entity; e02) Joint extraction of relations and attributes, based on entity recognition and disambiguation, the model relies on... Based on the carbon accounting rules and relational or attribute constraints, extract the relationships between entities and the key attributes of the entities (values, units, statistical periods, data sources, etc.), and calculate the accuracy of relation extraction. in, To correctly extract the number of relations, This represents the total number of relations extracted.

[0040] e03) Structured knowledge results organization, the model strictly follows... The prescribed structured format organizes the extracted entity, relation, and attribute information into a set of entity-relation-attribute triples. This results in structured knowledge, which can be directly used as incremental input for the carbon nuclear knowledge graph.

[0041] S403: Optimize the quality of structured knowledge results: f01) Consistency determination: This involves checking whether the relational logic of the structured knowledge results conforms to carbon accounting standards and industry verification rules, whether the attribute values ​​and units are reasonably matched, and whether there are contradictions among multiple attributes of the same entity (such as mismatch between emission unit and emission factor unit). Abnormal results are marked and submitted for manual review or a re-extraction process is triggered. Only when the consistency determination conditions are met are they included in the subsequent map construction stage. The consistency determination formula is: in, Represents relational logical rules and constraints. This indicates unit matching rule constraints. This represents a constraint based on attribute consistency rules.

[0042] f02) Redundancy removal: The system identifies duplicate knowledge extracted from different text fragments or different positions of the same text, including duplicate entities, redundant relationships and attributes, and merges these duplicate or highly overlapping knowledge contents to eliminate information redundancy.

[0043] S404: Construction and Dynamic Update of Carbon Verification Knowledge Graph The optimized structured knowledge results are used to construct a carbon verification knowledge graph, and the basic resource base is dynamically iterated. ; in, To update the global carbon verification knowledge graph, For the existing knowledge graph, This is the newly added and optimized set of triples.

[0044] g01) Incremental construction of knowledge graph, optimizing the set of triples Write it into the carbon verification knowledge graph and update it incrementally in a quantitative way: in, 、 、 These represent the number of newly added entities, relationships, and attributes. , Given the number of elements in the set, complete the expansion of the knowledge graph according to the formula.

[0045] g02) The basic resource base is dynamically iterated, and newly generated knowledge graph fragments are... The historical atlas fragment library is synchronously updated to the basic resource repository, and its retrieval index is updated accordingly, enabling dynamic updates of the basic resource repository and calculating domain knowledge coverage. in, The number of core knowledge points covered by the graph. This represents the total number of core knowledge points in the target domain.

[0046] In addition, to assess the quality of the spectral structure, the spectral density is calculated: in, For the number of relations, This represents the number of entities; a higher density value indicates a richer spectral structure.

[0047] Example 2 This embodiment describes a system for constructing a knowledge graph in the carbon verification field based on prompting engineering, as described in Embodiment 1, comprising: The basic resource library module is used to store and maintain the carbon accounting standard library, industry guide library, and historical map fragment library; The hierarchical prompt template library module is used to store and manage pre-defined three-level prompt templates; The text preprocessing module is used to clean, standardize, and semantically segment multi-source unstructured text to obtain a set of text fragments to be processed. The retrieval enhancement module is used to identify the topic of text fragments and retrieve relevant domain knowledge from the basic resource library to generate dynamic enhanced prompts; The knowledge extraction module is used to call a general large language model to complete domain knowledge extraction under prompting. The knowledge graph construction module is used to optimize the quality of the extracted results and complete the construction and updating of the knowledge graph.

[0048] The modules work together to achieve the entire process of building a high-quality carbon verification knowledge graph from unstructured text.

[0049] This method and system utilize domain knowledge-enhanced prompting engineering techniques to drive a general-purpose large language model to extract knowledge in the carbon verification field under zero-sample or few-sample conditions. This eliminates the need for large-scale labeled data and model retraining, adapts to low-resource scenarios in carbon verification, and the constructed high-quality carbon verification knowledge graph can be directly applied to practical business scenarios such as verification automation, emissions data analysis, and standard compliance verification.

[0050] Example 3 This embodiment provides a specific implementation process for a knowledge graph construction method in the field of carbon verification based on prompting engineering, including: a) Steps for constructing a basic resource database in the field of carbon verification; b) Steps for building a domain-customized hierarchical suggestion template library; c) Preprocessing steps for multi-source unstructured text; d) Steps for generating dynamic enhancement suggestions for search enhancement; e) Prompt-driven carbon verification domain knowledge extraction steps; f) Steps to optimize the quality of structured knowledge results; g) Steps for constructing and dynamically updating the carbon verification knowledge graph; a) Steps for constructing a basic resource database in the field of carbon verification.

[0051] a01) Build a structured storage framework for the carbon accounting standard library, use a structured database to store the core content of carbon accounting standards such as ISO 14064 and GHG Protocol, establish an index system for professional terms and accounting rules, support accurate retrieval by terminology, emission source and standard type, and reserve a standard update interface to adapt to the dynamic changes of carbon accounting standards. a02) Construct an industry classification retrieval system for the industry guide library. Classify and build the library according to industries such as power, steel, chemical, and transportation. Each industry sub-library stores the carbon emission source identification guidelines, quantification methods, verification processes, etc. of that industry. Establish the association mapping between industries and emission sources and accounting methods to realize rapid retrieval of industry knowledge. (a03) Design a triplet storage and mapping mechanism for the historical graph fragment library, in order to Using the basic storage unit, text source information is marked for each graph fragment. An association mapping between graph fragments and original text is established through unique entity IDs. A similar case retrieval algorithm is designed to reuse historical knowledge structures based on entity similarity and relation similarity. At the same time, an incremental update interface is developed to support the verification and import of new graph fragments.

[0052] b) Steps for building a domain-customized hierarchical suggestion template library: b01) Design a standardized output constraint template for the meta-hint layer, specify that the model output is a JSON-formatted entity-relationship-attribute triple structure, formulate an anti-illusion rule expression template, force the model to label unmentioned information as "unmentioned", and determine the fusion method of hints at each level; b02) Construct domain sub-task templates for the task prompting layer, design special prompt templates for entity recognition and disambiguation, relation extraction, and attribute filling, embed common entity types, relation types, and attribute constraints in the carbon verification domain, embed professional terminology definitions and accounting rule expressions, and form a standardized domain task prompting corpus; b03) Develop a dynamic knowledge injection interface for the contextual prompt layer, and design a knowledge fragment format conversion module to convert unstructured or structured domain knowledge retrieved from the basic resource library into a prompt corpus format that the model can recognize. Support the length adaptation of knowledge fragments and the extraction of key information to ensure the conciseness and accuracy of the prompts.

[0053] c) Multi-source unstructured text preprocessing steps c01) Develop a multi-format document parsing and cleaning module that supports the parsing of carbon verification text in multiple formats such as PDF, Word, and TXT. Remove noise information through regular expressions and text filtering algorithms, establish a standardized dictionary of carbon verification professional terms to unify terminology, and complete the standardized conversion of dates and units of measurement. c02) Implement a text segmentation algorithm based on semantic similarity, generating word vectors for text sentences based on a pre-trained word vector model, and then... Calculate the semantic similarity between sentences, set a threshold, and divide sentences with similarity higher than the threshold into a text segment, generating a set of text segments to be processed. Add topic tags to each segment.

[0054] d) Steps for generating dynamic enhancement suggestions for search enhancement d01) Call the semantic analysis interface of the general large language model to process the text fragment. Input the model, guide the model to identify core business scenarios and accounting topics through prompts, extract core keywords based on the model output results, generate a keyword weight matrix, and retain the top N keywords by weight as the retrieval basis; d02) Build a multi-database joint retrieval engine, integrate keyword matching and semantic similarity retrieval algorithms, and search the carbon accounting standard library, industry guide library, and historical map fragment library based on core keywords. Calculate the semantic similarity between the retrieval results and text fragments. After sorting and threshold filtering, select the knowledge fragments of the Top-K keywords as the domain knowledge to be injected. d03) Develop a dynamic assembly engine for prompt templates, importing the domain knowledge to be imported into the context prompt layer, combining the format constraints of the meta prompt layer with the domain task logic of the task prompt layer, and based on... Complete the splicing and merging of the three layers of prompts to generate personalized enhanced prompts. .

[0055] e) Hint-driven carbon verification domain knowledge extraction steps e01) Construct a model input format conversion module to concatenate the text fragment to be processed with enhanced prompts into an input format that can be recognized by a general large language model. After inputting the input into the model, the model identifies candidate entities in the carbon verification domain and generates an entity set. Based on the domain knowledge in the prompts, ambiguous entities are disambiguated, and each entity is assigned a unique ID and type label; e02) By enhancing prompts, the model is guided to complete the joint extraction of relationships and attributes, identify the relationships between entities and label the relationship types, extract key attributes such as the value, unit, and statistical period of the entity, and form attribute key-value pairs; e03) Develop a structured results organization module to complete the structured encapsulation of results according to the format specified by the meta-hint layer, ensuring that the results can be directly used as incremental input for the knowledge graph.

[0056] f) Steps to optimize the quality of structured knowledge results f01) Establish a carbon accounting rule consistency verification library to store various accounting rules, unit matching relationships, attribute constraints, develop verification algorithms, check the relationship logic, numerical units, and attribute consistency of structured knowledge results one by one, mark abnormal results and generate review prompts, and only after manual review is passed can the next step be carried out. f02) Design a triple redundancy removal algorithm. Based on the unique entity ID, relation type, and attribute value, check the structured knowledge results for duplicates, merge duplicate triples, fuse highly overlapping knowledge content, remove redundant information, and generate unique triple results.

[0057] g) Steps for constructing and dynamically updating the carbon verification knowledge graph g01) Construct a graph database storage framework for the carbon tracer knowledge graph, based on... The optimized set of triples Write into the existing knowledge graph This completes the incremental construction of the knowledge graph; g02) Develop a module for dynamically updating the basic resource library, which will update newly generated knowledge graph fragments. After format conversion, the historical graph fragment library is imported, the mapping relationship between graph fragments and original text is updated, and the basic resource library is dynamically iterated to improve the accuracy of subsequent knowledge retrieval and prompt enhancement.

[0058] The beneficial effects of this invention include: (1) For the sub-tasks of entity recognition, relation extraction and attribute filling in the carbon verification knowledge graph construction, a hierarchical template library of "meta hints - task hints - context hints" is designed. The carbon verification professional terminology definition, accounting rules and output format constraints are directly solidified into the template. Unlike the general hint method, it enables the large model to understand the task from the perspective of domain experts and complete the knowledge extraction with high quality under zero or few sample conditions, which fundamentally solves the problem of low resource construction in the domain. (2) Using a large model to understand the intent of text fragments, the most relevant contextual knowledge is automatically retrieved from the pre-built carbon accounting standard library, industry guide library and historical map fragment library, and dynamically injected into hierarchical prompt templates to form enhanced prompts. This mechanism effectively improves the accuracy of disambiguation of professional terms and judgment of complex relationships, and becomes the key to ensuring the quality of knowledge extraction under low resource conditions.

[0059] The preferred embodiments of the present invention have been described in detail above. It should be understood that those skilled in the art can make numerous modifications and variations based on the concept of the present invention without creative effort. Therefore, all technical solutions that can be obtained by those skilled in the art based on the concept of the present invention through logical analysis, reasoning, or limited experimentation on the basis of existing technology should be within the scope of protection defined by the claims.

Claims

1. A method for constructing a knowledge graph in the field of carbon verification based on prompting engineering, characterized in that, include: Acquire unstructured text from multiple sources, including corporate carbon emission reports, industry verification guidelines, and carbon accounting standard documents, and preprocess it to obtain a set of text fragments to be processed; Calculate the similarity between any two text segments in the set of text segments to be processed. If the similarity is higher than a preset similarity threshold, they are grouped into one segment; if the similarity is lower than the threshold, they are grouped into two segments, resulting in an independent set of text segments. Semantic analysis is performed on each text fragment in the set of independent text fragments to generate topic keywords and corresponding weights; based on the topic keywords and corresponding weights, keyword matching retrieval and semantic similarity calculation are performed in a pre-constructed knowledge base to obtain keyword matching similarity and semantic similarity; based on the keyword matching similarity and semantic similarity, a comprehensive retrieval similarity is calculated; Based on preset format and rule constraints, subtask logic and domain knowledge, and the comprehensive retrieval similarity, enhanced prompt words are generated; Based on the enhanced prompt words, knowledge is extracted from the text fragments in the set of independent text fragments to obtain structured knowledge results and perform quality optimization. Based on the optimized knowledge results, a knowledge graph for the carbon verification field is constructed.

2. The method for constructing a knowledge graph in the field of carbon verification based on prompting engineering according to claim 1, characterized in that, Semantic analysis is performed on the text fragment to be processed to obtain topic keywords and their corresponding weights. The formula for calculating the weights is as follows: in, Let be the weight of the j-th keyword in the i-th text segment. For word frequency, The number of times keyword j appears in text segment i. Inverse document frequency, The total number of documents in the basic resource library. The number of documents containing the keyword j. This represents the number of times keyword j appears in text segment k.

3. The method for constructing a knowledge graph in the field of carbon verification based on prompting engineering according to claim 1, characterized in that, Based on the keyword matching similarity and semantic similarity, the comprehensive retrieval similarity is calculated, and the corresponding calculation formula is as follows: in, These are the weighting coefficients. For keyword matching similarity, For semantic similarity, Let represent the i-th text segment to be processed, and k represent a candidate contextual knowledge in the knowledge base.

4. The method for constructing a knowledge graph in the field of carbon verification based on prompting engineering according to claim 1, characterized in that, The knowledge extraction process specifically includes: First, disambiguation similarity is calculated based on the enhanced prompt words, and then disambiguation is performed on the text segments in the set of independent text segments; the formula for calculating the disambiguation similarity is: in, For the entity to be identified, For standard entities, For terminology similarity, For contextual similarity; Based on the enhanced prompt words, entity relations and entity attributes are extracted from the unambiguous text fragments; the extracted entity relations and entity attributes are combined to obtain the structured knowledge results.

5. A method for constructing a knowledge graph in the field of carbon verification based on prompting engineering, as described in claim 1, characterized in that, The cosine similarity method is used to calculate the similarity between the text segments in the set of text segments to be processed. The corresponding calculation formula and judgment rule are as follows: Where α is a dynamically set threshold. This is the set of sentence similarities in the current document. The mean similarity. The standard deviation of similarity To adjust the coefficient, Given the word vectors of the two sentences, Here is the formula for calculating similarity. The similarity determination rules are as follows.

6. The method for constructing a knowledge graph in the field of carbon verification based on prompting engineering according to claim 1, characterized in that, The process of optimizing the quality of the structured knowledge results specifically includes: The structured knowledge results are subjected to consistency assessment; any abnormal results are marked and reviewed; the knowledge results that pass the consistency assessment are used to construct the knowledge graph for the carbon verification field; the formula for consistency assessment is: in, Represents relational logical rules and constraints. This indicates unit matching rule constraints. This represents a constraint based on attribute consistency rules. , For structured knowledge results, This is the determination formula.

7. A method for constructing a knowledge graph in the field of carbon verification based on prompting engineering, as described in claim 1, characterized in that, The format and rule constraints are obtained from the pre-built meta-hint layer to solidify the structured format specifications of the model output; the sub-task logic and domain knowledge are obtained from the pre-built task hint layer, wherein the sub-task logic and domain knowledge specifically include entity types, relation types and attribute constraints in the carbon verification domain; Based on the comprehensive retrieval similarity, standard clauses, industry norms, and historical graph information are filtered from the knowledge base to obtain the domain knowledge to be imported. The enhanced prompt words are obtained by combining the format and rule constraints, subtask logic and domain knowledge, and the domain knowledge to be imported.

8. A method for constructing a knowledge graph in the field of carbon verification based on prompting engineering, as described in claim 1, characterized in that, The optimized knowledge result is a set of triples consisting of entities, relations, and attribute numbers; based on the set of triples, the pre-constructed carbon verification knowledge graph is expanded to obtain the carbon verification domain knowledge graph.

9. A method for constructing a knowledge graph in the field of carbon verification based on prompting engineering, as described in claim 8, is characterized in that, The graph density of the carbon verification knowledge graph is calculated to assess its structural quality, yielding a quality assessment result. The corresponding calculation formula is as follows: in, For the number of relations, For entity number, For the knowledge graph of carbon verification field, The graph density of the knowledge graph in the field of carbon verification; Based on the quality assessment results, quality optimization is performed to obtain the optimized knowledge results.

10. A system for constructing a knowledge graph in the field of carbon verification based on prompting engineering as described in any one of claims 1-9, characterized in that, include: The basic resource library module is used to store and maintain basic resource libraries, industry guide libraries, and historical map fragment libraries in the field of carbon verification. The hierarchical prompt template library module is used to store and manage pre-defined three-level prompt templates; The text preprocessing module is used to clean, standardize, and semantically segment multi-source unstructured text to obtain a set of text fragments to be processed. The retrieval enhancement module is used to perform semantic analysis, keyword matching retrieval, and semantic similarity calculation on the set of text fragments to be processed, and generate a comprehensive retrieval similarity; further, based on preset format and rule constraints, subtask logic and domain knowledge, and the comprehensive retrieval similarity, it generates enhanced prompt words; The knowledge extraction module is used to extract knowledge from text fragments in the set of independent text fragments based on the enhanced prompt words, and obtain structured knowledge results; The knowledge graph construction module is used to optimize the quality of the structured knowledge results and construct a knowledge graph in the field of carbon verification based on the optimized knowledge results.

Citation Information

Patent Citations

  • Intelligent file review system and method based on carbon check knowledge graph

    CN116383414A

  • Electric power design knowledge base construction method fusing multi-modal data and RAG technology

    CN120929611A

  • Power document keyword extraction method based on Prompt and knowledge graph

    CN121525801A

  • Reservoir hydropower station carbon accounting key information extraction method and system based on large language model

    CN121743367A

  • Knowledge graph-based unified fault search method for specialized vehicle device

    WO2025241251A1