Water conservancy knowledge graph construction method and device
By employing a two-way closed-loop feedback mechanism combining a large language model and a knowledge graph embedding model, the problem of coordinating semantic understanding and global structural reasoning in water conservancy knowledge graphs is solved, improving the accuracy and stability of water conservancy professional knowledge extraction, especially in handling complex water conservancy logic and low-frequency long-tail relationships.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- GUODIAN DADU RIVER POWER ENG
- Filing Date
- 2026-03-25
- Publication Date
- 2026-07-31
AI Technical Summary
Existing technologies struggle to achieve effective collaboration and feedback error correction between semantic understanding and global structural reasoning in water conservancy knowledge graphs, resulting in low accuracy and structural stability in the extraction of complex water conservancy professional knowledge.
We employ a large language model and a pre-defined ontology model to extract knowledge from unstructured text in the water conservancy field. We combine a knowledge graph embedding model to construct a two-way closed-loop feedback mechanism. Through structural rationality scoring and multi-objective condition constraint consistency verification, we achieve hierarchical knowledge extraction and global consistency verification. We then use the high-quality data after error correction to optimize the structural model.
It improves the accuracy and structural stability of extracting complex water conservancy expertise, solves the limitations of single models in handling complex water conservancy logic and low-frequency long-tail relationships, and realizes dynamic alignment and continuous evolution of semantic features and structural features in a unified space.
Smart Images

Figure CN122491275A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of knowledge graph construction technology, and in particular to a method and apparatus for constructing a water conservancy knowledge graph. Background Technology
[0002] The operation of cascade hydropower stations generates a large amount of structured and unstructured data, which contains rich domain knowledge and is of great value for improving the scheduling efficiency of hydropower stations, optimizing resource allocation, and realizing intelligent decision-making.
[0003] Knowledge graphs (KGs) are widely used in complex domain knowledge management and reasoning tasks because they can organize entities and their relationships in a structured way. Since a large amount of key knowledge exists in the form of unstructured text, such as operation reports, technical documents and industry standards, how to automatically extract entities and relationships from these texts and build high-quality knowledge graphs has become an important research problem.
[0004] Currently, knowledge extraction technologies include traditional pipeline extraction methods and extraction methods based on Large Language Models (LLM). The former separates entity recognition and relation extraction into independent subtasks, relies on expensive manually labeled data, and lacks information sharing between modules, which easily leads to the continuous accumulation of errors in the front-end modules. On the other hand, LLM-based extraction methods rely on local semantics for reasoning, which easily produces factual errors or logically illogical "illusion" triples. In other words, the above knowledge extraction technologies struggle to achieve effective collaboration and feedback error correction between semantic understanding and global graph structure reasoning, resulting in low accuracy and structural stability in the extraction of complex water conservancy professional knowledge. Summary of the Invention
[0005] This invention provides a method and apparatus for constructing a water conservancy knowledge graph, which addresses the shortcomings of existing knowledge extraction methods that struggle to achieve effective collaboration and feedback error correction between semantic understanding and global graph structure reasoning, resulting in low accuracy and structural stability in the extraction of complex water conservancy professional knowledge.
[0006] This invention provides a method for constructing a water conservancy knowledge graph, comprising: Knowledge extraction is performed on unstructured texts in the water conservancy field using a large language model and a pre-defined ontology model to obtain initial triple information and corresponding original text evidence information; The rationality of the structure of the initial triplet information is scored using a knowledge graph embedding model, resulting in a structural rationality score. A two-way closed-loop feedback mechanism is constructed between the large language model and the knowledge graph embedding model based on structural rationality scoring; the two-way closed-loop feedback mechanism includes: When the structural rationality score is within a preset feedback range, the large language model is driven to perform reasoning and error correction based on the structural diagnostic signals generated by the knowledge graph embedding model and the original text evidence information, and the obtained triple information is used as high-confidence triple information; when the structural rationality score is within a preset acceptance range, the triple information corresponding to the structural rationality score is determined as high-confidence triple information; the knowledge graph embedding model is incrementally updated based on the high-confidence triple information; A bidirectional closed-loop feedback mechanism is executed cyclically. When the bidirectional closed-loop feedback mechanism meets the preset convergence condition, a water conservancy knowledge graph is constructed based on the high-confidence triple information output by each iteration.
[0007] According to the water conservancy knowledge graph construction method provided by the present invention, the preset ontology model also includes category information and hierarchical relationships of different entities; Knowledge extraction is performed on unstructured text in the water resources field using a large language model and a pre-defined ontology model, yielding initial triplet information and corresponding original text evidence information, including: Based on hierarchical relationships and category information, determine the set of coarse-grained categories and the subset of fine-grained relationships associated with each coarse-grained category; Entity pairs are extracted from unstructured text using a large language model, and the target coarse-grained category to which the entity pairs belong is predicted in a coarse-grained category set. The output space of the large language model is constrained to a subset of target fine-grained relations associated with target coarse-grained categories, and the large language model is driven to extract target fine-grained relations between entity pairs in the subset of target fine-grained relations. Based on entity pairs, target fine-grained relationships, and corresponding text fragments in unstructured text, generate initial triplet information and original text evidence information.
[0008] According to a water conservancy knowledge graph construction method provided by the present invention, the rationality of the structure of initial triplet information is scored using a knowledge graph embedding model to obtain a structural rationality score, including: Calculate the semantic feature vector of the unseen entity in the initial triplet information; Using a pre-defined linear projection matrix, semantic feature vectors are mapped to the complex vector space corresponding to the knowledge graph embedding model to obtain the initial representation of unseen entities; The initial triple information is updated using the initialization representation, and the rationality of the structure of the updated triple information is scored using a knowledge graph embedding model to obtain a structural rationality score.
[0009] According to the method for constructing a water conservancy knowledge graph provided by the present invention, the updated triplet information includes a head entity, a relation, and a tail entity, and the relation represents the rotation operation from the head entity to the tail entity in the complex vector space; The rationality of the structure of the updated triplet information is scored using a knowledge graph embedding model, resulting in a structural rationality score, including: Obtain the complex vector representations of the head entity, relation, and tail entity in the complex vector space; Calculate the element-wise product between the complex vector representation of the head entity and the complex vector representation of the relation, and calculate the distance difference score between the element-wise product and the complex vector representation of the tail entity to obtain the structural rationality score.
[0010] According to the method for constructing a water conservancy knowledge graph provided by the present invention, the preset ontology model includes domain constraint information corresponding to different entities; After obtaining the initial triplet information and the corresponding original text evidence information, the method also includes: Based on domain constraint information, the initial triplet information is subjected to multi-objective condition constraint consistency verification. The multi-objective condition constraints include flood control constraints, power generation constraints, and ecological constraints with a preset priority order. Given that the initial triplet information satisfies the consistency of multi-objective constraints, the rationality of the structure of the initial triplet information is scored using a knowledge graph embedding model, resulting in a structural rationality score.
[0011] According to the present invention, a method for constructing a water conservancy knowledge graph is provided, which constructs a two-way closed-loop feedback mechanism between a large language model and a knowledge graph embedding model based on a structural rationality score, including: Multi-partition verification is performed on the distribution information of the structural rationality scores corresponding to the triplet information of the current batch to determine the high score threshold and low score threshold; Based on the high score threshold and the low score threshold, the scoring interval is divided into a preset acceptance interval, a preset feedback interval, and a preset rejection interval; If the structural rationality score is within the preset rejection range, the initial triplet information is removed from the triplet information of the current batch.
[0012] The present invention also provides a water conservancy knowledge graph construction device, comprising: The knowledge extraction module is used to extract knowledge from unstructured text in the water conservancy field using a large language model and a preset ontology model, to obtain initial triple information and corresponding original text evidence information. The structural rationality scoring module is used to score the structural rationality of the initial triplet information using a knowledge graph embedding model, and obtain a structural rationality score. The feedback module is used to construct a two-way closed-loop feedback mechanism between the large language model and the knowledge graph embedding model based on the structural rationality score; the two-way closed-loop feedback mechanism includes: When the structural rationality score is within a preset feedback range, the large language model is driven to perform reasoning and error correction based on the structural diagnostic signals generated by the knowledge graph embedding model and the original text evidence information, and the obtained triple information is used as high-confidence triple information; when the structural rationality score is within a preset acceptance range, the triple information corresponding to the structural rationality score is determined as high-confidence triple information; the knowledge graph embedding model is incrementally updated based on the high-confidence triple information; The graph construction module is used to repeatedly execute the bidirectional closed-loop feedback mechanism. When the bidirectional closed-loop feedback mechanism meets the preset convergence conditions, it constructs a water conservancy knowledge graph based on the high-confidence triple information output by each iteration.
[0013] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the water conservancy knowledge graph construction method as described above.
[0014] The present invention also provides a non-transitory computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the water conservancy knowledge graph construction method as described above.
[0015] The present invention also provides a computer program product, including a computer program that, when executed by a processor, implements the water conservancy knowledge graph construction method as described above.
[0016] The water conservancy knowledge graph construction method and apparatus provided by this invention jointly extract unstructured text in the water conservancy field using a large language model and a preset ontology model, achieving hierarchical preliminary knowledge extraction. A knowledge graph embedding model is used to perform a global consistency check on the initial triplet information, quantifying the risk of illusions or factual errors in the triplets. By constructing dynamic partitioning routing rules, a bidirectional information flow is established between the large language model and the knowledge graph embedding model. This allows for structure-guided semantic error correction, and the high-quality data after error correction is used to optimize the structural model, overcoming the limitations of a single model in handling complex water conservancy logic, especially low-frequency long-tail relationships. Finally, through iterative and convergence mechanisms, dynamic alignment and continuous evolution of semantic and structural features in a unified space are achieved, improving the accuracy and structural stability of extracting complex water conservancy professional knowledge. Attached Figure Description
[0017] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0018] Figure 1 This is one of the flowcharts of the water conservancy knowledge graph construction method provided by the present invention.
[0019] Figure 2 This is the second flowchart of the water conservancy knowledge graph construction method provided by the present invention.
[0020] Figure 3 This is a schematic diagram of the structure of the water conservancy knowledge graph construction device provided by the present invention.
[0021] Figure 4 This is a schematic diagram of the structure of the electronic device provided by the present invention. Detailed Implementation
[0022] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.
[0023] The following is combined Figures 1-3 The present invention describes a method and apparatus for constructing a water conservancy knowledge graph.
[0024] Figure 1 This is one of the flowcharts illustrating the water conservancy knowledge graph construction method provided by the present invention, such as... Figure 1 As shown, the method includes the following: Step 110: Use a large language model and a pre-set ontology model to extract knowledge from unstructured texts in the water conservancy field to obtain initial triplet information and corresponding original text evidence information.
[0025] In this step, large language models, including base models such as DeepSeek-V3, are used to automatically identify entities and their relationships from complex and lengthy water conservancy texts.
[0026] In this step, the preset ontology model can be a pre-defined structured knowledge graph schema in the water conservancy field. The preset ontology model includes entity types such as hydropower stations, generating units, and scheduling targets, as well as a hierarchical relational structure consisting of coarse-grained categories (such as scheduling constraints) to fine-grained relations (such as limiting power generation flow). It is mainly used to constrain the output space of the large language model and reduce the difficulty of extracting long-tail relations.
[0027] In this step, unstructured text in the water conservancy field can be scheduling procedures, operation logs, or policy documents generated during daily operations. This unstructured text can be obtained from a corpus of documents in the field of cascade hydropower stations.
[0028] In this step, the initial triplet information is preliminary structured data consisting of the extracted head entity, relation, and tail entity; the original text evidence information is the extracted original text fragments that the triplet directly depends on, which are used to provide a backtracking basis for subsequent error correction and verification.
[0029] For example, suppose the input unstructured text is: "During the flood season, to ensure the flood control safety of the dam, Hydropower Station A must limit the power generation flow of its units; at the same time, since Hydropower Station A is located upstream of Hydropower Station B, the two are hydraulically connected." The system uses a sliding window to divide this long text into blocks, inputs it into a large language model, and provides prompts based on the hierarchical relationship categories in the preset ontology model. After semantic parsing, the large language model outputs the initial triplet information (Hydropower Station A, located upstream of..., Hydropower Station B), and extracts the text "Hydropower Station A is located upstream of Hydropower Station B" as the corresponding original text evidence information.
[0030] Step 120: Use the knowledge graph embedding model to score the rationality of the structure of the initial triplet information and obtain the structural rationality score.
[0031] In this step, the knowledge graph embedding model (such as the RotatE model) can be a machine learning model that maps entities and relations to a low-dimensional continuous vector space (such as a complex space) for numerical representation. The knowledge graph embedding model utilizes the global topological structure of the knowledge graph to cross-validate the data.
[0032] In this embodiment, the initial triplet information is the data to be verified extracted from the large model in step 110. The structural rationality score is a probability value calculated by a scoring function (such as the complex space rotation distance formula) embedded in the model, which is used to objectively measure the probability of the triplet being logically valid in the overall water conservancy entity relationship network.
[0033] In this embodiment, the RotatE model is used as a structural validator to perform global consistency verification on the extracted initial triplet information, which can effectively handle common symmetric (such as hydraulic connection between A and B) and inverse relationships (such as A being downstream of B) in the field of hydropower.
[0034] Step 130: Construct a two-way closed-loop feedback mechanism between the large language model and the knowledge graph embedding model based on the structural rationality score; the two-way closed-loop feedback mechanism includes: When the structural rationality score is within a preset feedback range, the large language model is driven to perform reasoning and error correction based on the structural diagnostic signals generated by the knowledge graph embedding model and the original text evidence information, and the obtained triple information is used as high-confidence triple information; when the structural rationality score is within a preset acceptance range, the triple information corresponding to the structural rationality score is determined as high-confidence triple information; the knowledge graph embedding model is incrementally updated based on the high-confidence triple information.
[0035] In this step, the preset feedback interval is the score range in the middle or lower percentile (e.g., 25% to 70%) of the score distribution, used to characterize that the current triple information is questionable and needs to be reviewed; the preset acceptance interval is the score range in the high percentile (e.g., greater than 70%), representing that the structure is highly reliable.
[0036] In this step, the structural diagnostic signal can be a more structurally reasonable alternative relationship suggestion output by the knowledge graph embedding model through link prediction. In this embodiment, the diagnostic signal is combined with the original text, which can drive the large model to re-infer and correct errors using the chain of thought (CoT) and output the correct result, namely the high-confidence triple information.
[0037] In this embodiment, the parameters of the knowledge graph embedding model are fine-tuned using high-confidence triple information, enabling it to learn new water conservancy entity relationship patterns, thereby achieving incremental updates.
[0038] In this embodiment, the bidirectional closed-loop feedback mechanism includes two channels: (1) evidence-guided CoT correction (KGE) LLM), (2) Verify triplet integration (LLM) KGE).
[0039] Specifically, regarding (1) evidence-guided CoT correction (KGE) For LLM (Low Confidence Triples) that are classified as Feedback Paths, the system can trigger the following re-inference process: ① Evidence retrieval: Based on entity anchors, retrieve all candidate sentences containing the entity pair from the original text.
[0040] ② Diagnostic signal generation: Link prediction is performed using the KGE model, providing the Top-k structurally more reasonable alternative relationships. .
[0041] ③CoT prompt word construction: Provide LLM with original triples, structured diagnostic suggestions and original text evidence, and require them to use thought chain to determine whether there are extraction errors and make corrections.
[0042] For (2) Validation of triplet integration (LLM) KGE), for structural rationality scores within the preset acceptance range or high-confidence triples after channel 1 correction, are used as new monitoring signals, and iterative feedback is achieved in conjunction with the following strategy: (2.1) Incremental fine-tuning: A hot start strategy is adopted to update the KGE model in a limited number of rounds so that it learns new hydropower relationship patterns.
[0043] (2.2) Adverse negative sampling: Adaptive negative sampling is introduced during the fine-tuning process to improve the model's accuracy in discriminating low-frequency long-tail relationships.
[0044] For example, suppose the large language model extracts a triple (hydropower station A, mutually compensated by cascades, hydropower station C), whose structural rationality score is 0.45, falling into the preset feedback interval. At this point, the system triggers feedback correction, and the knowledge graph embedding model generates a structural diagnostic signal (hinting that, based on the global topology, the two are more likely to have "no direct hydraulic connection"). The system (the method execution entity) inputs this diagnostic signal along with the previous original text evidence information into the large language model. The large language model rereads the procedure text through the thought chain and corrects the current triple information to (hydropower station A, no direct hydraulic connection, hydropower station C), thus obtaining the corrected high-confidence triple. At the same time, for the triple (hydropower station A, located upstream of..., hydropower station B) with a score of 0.88, because it is within the preset acceptance interval, it is directly confirmed as a high-confidence triple. Finally, the system uses these high-confidence data to perform a limited number of rounds of incremental fine-tuning training on the knowledge graph embedding model.
[0045] Step 140: Execute the bidirectional closed-loop feedback mechanism repeatedly. If the bidirectional closed-loop feedback mechanism meets the preset convergence conditions, construct a water conservancy knowledge graph based on the high-confidence triplet information output in each iteration.
[0046] In this step, by repeatedly executing a two-way closed-loop feedback mechanism, the system can automatically and repeatedly perform the process of "semantic extraction - structural scoring - feedback error correction - model update".
[0047] In this step, the preset convergence condition refers to the set stopping threshold used to determine whether knowledge extraction has become saturated or stable (such as the growth rate of the verification triple being less than 0.01, or reaching the preset maximum number of cycles, 4 rounds).
[0048] In this step, the high-quality structured data accumulated in each iteration will be integrated to construct a water conservancy knowledge graph. This water conservancy knowledge graph is a mesh database that can directly provide underlying technical support for intelligent scheduling of cascade hydropower stations and flood control optimization.
[0049] This embodiment was implemented in an environment equipped with an NVIDIA A100 GPU and used a 512-dimensional complex embedding space. Experiments show that on a dataset containing millions of characters of water conservancy regulations and scheduling outlines, the scheme improves the micro-average F1 score by 11.2% compared to the baseline model and exhibits significant robustness in handling complex long-tail relationships such as "multi-objective conflict constraints".
[0050] The water conservancy knowledge graph construction method provided in this invention achieves hierarchical preliminary knowledge extraction by jointly extracting unstructured text in the water conservancy field using a large language model and a preset ontology model. It uses a knowledge graph embedding model to perform a global consistency check on the initial triplet information, quantifying the risk of illusions or factual errors in the triples. By constructing dynamic partitioning routing rules, a bidirectional information flow is established between the large language model and the knowledge graph embedding model. This allows for structure-guided semantic error correction and optimization of the structural model using high-quality data after error correction, overcoming the limitations of a single model in handling complex water conservancy logic, especially low-frequency long-tail relationships. Finally, through iterative and convergence mechanisms, it achieves dynamic alignment and continuous evolution of semantic and structural features in a unified space, improving the accuracy and structural stability of extracting complex water conservancy professional knowledge.
[0051] In some embodiments, the pre-defined ontology model further includes category information and hierarchical relationships of different entities; knowledge extraction is performed on unstructured text in the water conservancy field using a large language model and the pre-defined ontology model to obtain initial triple information and corresponding original text evidence information, including: determining a coarse-grained category set and a fine-grained relationship subset associated with each coarse-grained category based on hierarchical relationships and category information; extracting entity pairs from the unstructured text using a large language model and predicting the target coarse-grained category to which the entity pair belongs in the coarse-grained category set; constraining the output space of the large language model to a target fine-grained relationship subset associated with the target coarse-grained category, and driving the large language model to extract the target fine-grained relationship between entity pairs in the target fine-grained relationship subset; generating initial triple information and original text evidence information based on entity pairs, target fine-grained relationships, and corresponding text fragments in the unstructured text.
[0052] In this embodiment, the preset ontology model includes not only entity types, but also category information and hierarchical relationships defined by water conservancy experts. In this embodiment, the coarse-grained category set refers to a broad set of relational categories (such as scheduling constraints, hydraulic connections, etc.); the fine-grained relation subset refers to the specific and precise relational types attached to each category (e.g., a total of 89 fine-grained relations, such as the restricted power generation flow and restricted water level under scheduling constraints); the target coarse-grained category is the relational direction determined by the large language model after preliminary analysis of the text semantics; and the target fine-grained relation is the precise micro-relationship finally determined within a limited scope.
[0053] The preset ontology model in this embodiment utilizes this hierarchical design to reduce the search and output space of a large language model from dozens or even hundreds of global relation libraries to a specific subset of only a dozen or so candidate relations on average, thereby reducing the difficulty of extracting long-tail relations and model illusion.
[0054] Specifically, this embodiment establishes a closed-loop feedback mechanism between LLM (Large Language Model, also known as Semantic Extractor) and KGE (Structured Validator). When obtaining the initial triplet information and the corresponding original text evidence information, the following steps are performed: (1) Problem Formalization and Definition: Let the document corpus of the cascade hydropower station field be... The predefined ontology model is represented as ,in: Represents a collection of entity types (such as hydropower stations, generating units, scheduling targets, constraints, etc.); This represents a two-level hierarchical structure, including coarse-grained categories. Relationship type with fine granularity ; This represents the set of domain constraints, specifying the allowed entity type pairs for each relation.
[0055] The goal of this embodiment is to construct a validated water resources knowledge graph. ,in It is a set of triples that satisfy ontology constraints and have structural rationality. .
[0056] (2) Hierarchical coarse-to-fine water conservancy knowledge extraction (semantic end): This embodiment does not adopt the traditional pipeline method that separates named entity recognition (NER) and relation extraction (RE), but uses LLM for joint extraction to reduce error accumulation. The specific process includes the following: (a) Document segmentation and preprocessing; Since technical documents for hydropower stations are usually quite long, a sliding window block strategy can be adopted: the block length is set to 2,000 characters, and an overlap of 200 characters is maintained between adjacent blocks to ensure the contextual integrity of cross-block relationships.
[0057] (b) Definition of joint extraction format: For each text block, the LLM output contains a raw tuple of five components. : in, These are the head and tail entities, respectively. From The fine-grained relationships selected (such as "limiting power generation flow" and "mutual cascade compensation") are as follows. The original text evidence grounding is used to support this triple. For the corresponding coarse-grained categories (such as "scheduling constraints" and "hydraulic connections").
[0058] (c) Cue-driven hierarchical classification; This embodiment explicitly guides the LLM to execute coarse-to-fine inference logic through the Prompt project: Step 1: Determine the category to which the target relation belongs from the 8 coarse-grained categories. ; Step 2: In the corresponding subset Select the most precise fine-grained relationship. This method reduces the search space from dozens of relationships to an average of about 11 per category, significantly reducing the difficulty of identifying long-tail relationships.
[0059] (d) In Vitro Relationship Remapping (OOS Remapping); If the relationship of LLM output The system triggers the remapping mechanism by: calling the auxiliary LLM, inputting the original triples and evidence. and legal sets The corresponding instruction is: select the legal relation with the closest semantics or mark it as discarded.
[0060] The water conservancy knowledge graph construction method provided in this invention achieves hierarchical knowledge extraction from coarse to fine through a preset ontology model, overcoming the defect of severe imbalance (i.e., long-tail distribution) in the distribution of multi-objective conditional constraint relationships in the text of cascade hydropower stations. Furthermore, by constraining the output space of a large language model, the model is guided to perform step-by-step logical reasoning, enabling the model to maintain extremely high recall and extraction accuracy when facing complex water conservancy relationships with low frequency and long tails, providing reliable data support for subsequent two-way collaborative verification.
[0061] In some embodiments, the rationality of the structure of the initial triplet information is scored using a knowledge graph embedding model to obtain a structural rationality score. This includes: calculating the semantic feature vectors of unseen entities in the initial triplet information; mapping the semantic feature vectors to the complex vector space corresponding to the knowledge graph embedding model using a preset linear projection matrix to obtain an initial representation of the unseen entities; updating the initial triplet information using the initial representation, and scoring the rationality of the structure of the updated triplet information using the knowledge graph embedding model to obtain a structural rationality score.
[0062] In this embodiment, an unseen entity (OOV entity) can be a new device or site that appears in different water conservancy documents and has not yet been included in the knowledge graph embedding model (such as a newly commissioned unit).
[0063] In this embodiment, the semantic feature vector of the unseen entity is a high-dimensional vector extracted after encoding the entity text using a pre-trained language model (such as the RoBERTa model). This vector includes rich contextual semantic features of the entity.
[0064] In this embodiment, the linear projection matrix is a weight matrix that has been pre-trained with cross-space alignment, used to seamlessly transform vectors in the pure text semantic space into the space required for graph structure computation; the complex vector space is the mathematical space in which the knowledge graph embedding model performs structure verification and rotation logic computation.
[0065] Specifically, in response to the OOV (Out-of-Vocabulary) problem of newly commissioned equipment or new sites in hydropower stations, this embodiment does not use random initialization, but instead learns a cross-spatial projection matrix and takes the following steps: (1) Extract semantic feature vectors of entities using a pre-trained Chinese RoBERTa model. .
[0066] (2) Through linear projection layer Map it to a complex rotation space: ; (3) Projection matrix Pre-training on a known entity set by minimizing the projection distance enables the model to immediately perform structural verification on newly emerging entities.
[0067] The water conservancy knowledge graph construction method provided in this invention solves the technical difficulties of cold start verification failure and scoring calculation failure caused by the lack of historical structure connections when new equipment and new site entities appear in new documents of hydropower stations. It uses a semantically guided entity initialization strategy and linear projection to map the semantic features of unseen entities to the KGE space.
[0068] In some embodiments, the updated triple information includes a head entity, a relation, and a tail entity, where the relation represents a rotation operation from the head entity to the tail entity in a complex vector space. A knowledge graph embedding model is used to score the structural rationality of the updated triple information, resulting in a structural rationality score. This includes: obtaining the complex vector representations of the head entity, relation, and tail entity in the complex vector space; calculating the element-wise product between the complex vector representation of the head entity and the complex vector representation of the relation, and calculating the distance difference score between the element-wise product and the complex vector representation of the tail entity to obtain the structural rationality score.
[0069] In this embodiment, the updated triplet information can be complete structured data obtained through cold start completion or direct extraction, containing three elements: head entity, relation, and tail entity.
[0070] In this embodiment, the complex vector space is a multidimensional complex mathematical environment constructed inside the knowledge graph embedding model (such as the RotatE model). For example, the features of an entity in the complex vector space not only have magnitude, but also phase (direction).
[0071] In this embodiment, the rotation operation defines the relationship between hydraulic entities (such as upstream and downstream, hydraulic connectivity) as a phase rotation on a complex plane, thereby meeting the modeling requirements of symmetric and inverse relationships commonly found in the field of hydraulics.
[0072] In this embodiment, the complex vector representation is the specific numerical coordinates of each element of the triplet in space; the element-wise product (Hadamard product) represents the mathematical calculation process of superimposing the rotation angles corresponding to the relation onto the head entity vector (e.g., ).
[0073] In this embodiment, the distance difference score is used to measure the spatial geometric distance between the landing point of the head entity after rotation and the actual location of the tail entity (e.g., denoted as...). The smaller the distance, the more logically consistent the result, and the higher the structural rationality score of the final output.
[0074] In this embodiment, the rationality of the structure of the initial triplet information is scored using a knowledge graph embedding model, which is essentially a structured verification (structure end) process based on complex space rotation.
[0075] In this process, a rotational scoring function can be used to calculate the reasonableness score corresponding to different three-group information.
[0076] Specifically, in In a complex vector space, entities and relations are both represented as A complex vector. Relationship The rotation operation is defined as the rotation from the head entity to the tail entity: ; in That is, each element of the relation vector is a complex number with a modulus of 1.
[0077] Triple group Structural rationality scoring function Defined as: ; in For the Sigmoid function, This represents the Hadamard product. A higher score indicates that the triple is more reliable in graph-structured logic.
[0078] The water conservancy knowledge graph construction method provided in this invention transforms the entity relationships in the water conservancy knowledge graph into mathematical rotation operations in a complex vector space, and maps the spatial distribution topology and hydraulic connections of cascade hydropower stations into quantifiable geometric distance calculations. This method can identify illusionary errors in large language models that violate common sense in physical topology, thereby providing a reliable diagnostic basis for a two-way collaborative feedback mechanism.
[0079] In some embodiments, the preset ontology model includes domain constraint information corresponding to different entities; after obtaining the initial triplet information and the corresponding original text evidence information, the water conservancy knowledge graph construction method further includes: performing multi-objective condition constraint consistency verification on the initial triplet information based on the domain constraint information, wherein the multi-objective condition constraints include flood control constraints, power generation constraints, and ecological constraints with a preset priority order; and, if the initial triplet information satisfies the multi-objective constraint consistency, using a knowledge graph embedding model to score the rationality of the structure of the initial triplet information to obtain a structural rationality score.
[0080] In this embodiment, when dealing with the multi-objective constraints of cascade hydropower stations (flood control priority, optimal power generation, and ecological considerations), the following process ensures rigor: (a) Constraint consistency verification; In the scenario of cascade hydropower station scheduling, operational decisions are typically constrained by multiple objectives, including flood control safety, power generation efficiency, and ecological protection. To ensure that the scheduling knowledge constructed in the knowledge graph conforms to the actual operational logic of water conservancy projects, this invention introduces a multi-objective constraint consistency verification mechanism based on ontology constraint checks.
[0081] In this embodiment, the scheduling objective of the cascade hydropower stations is formalized into three constraint variables. For flood control constraints, the main factors are determined by indicators such as water level, inflow, and flood control limit water level; The power generation priority constraint is mainly determined by indicators such as unit output, power generation flow rate and unit operating status; Ecological flow constraints are mainly determined by indicators such as ecological outflow and minimum ecological flow requirements.
[0082] In this embodiment, according to the principles of water conservancy scheduling, the priority relationship of multi-objective constraints can be expressed as follows: ; The above priority relationship indicates that, in the event of a conflict, flood control safety should be prioritized, followed by optimizing power generation efficiency, while also taking into account ecological flow requirements.
[0083] In this embodiment, in candidate triples After generation, the system first identifies the scheduling entities and attributes involved, and then maps them to the corresponding set of constraint variables. Subsequently, consistency verification is performed according to the aforementioned priority rules: if the scheduling relationship expressed by the triple violates the flood control priority principle or conflicts with the minimum ecological flow requirement, the triple is determined to have a constraint conflict and directly enters the feedback correction channel, where LLM combines the original text evidence to re-perform relation reasoning.
[0084] For triples that satisfy the consistency of multi-objective constraints, the process continues to the subsequent KGE structural scoring stage. By introducing this multi-objective constraint filtering mechanism before structural verification, the generation of erroneous knowledge that violates the principles of water conservancy scheduling can be effectively avoided, thereby improving the logical consistency and engineering reliability of the knowledge graph of cascade hydropower stations.
[0085] (b) Iterative convergence and graph generation; In this embodiment, the entire process is executed. In the initial iteration phase, the KGE model is relatively conservative, relying mainly on the semantic capabilities of LLM. In the later phase, KGE captures stable cascade power station topology logic and scheduling patterns, providing strong correction for semantic misjudgments (illusions) in LLM. When verifying the growth rate of the triplet... When the iteration stops, the final structured hydraulic knowledge graph is output; when the growth rate of the triple is verified... When the iteration stops, the final structured hydraulic knowledge graph is output.
[0086] The water conservancy knowledge graph construction method provided in this invention introduces a multi-objective condition constraint filtering mechanism, which solidifies the complex business bottom line of flood control priority, power generation optimization, and ecological consideration unique to cascade hydropower stations into pre-verification rules. This can intercept absurd knowledge that violates the actual operation principles of water conservancy projects, improve the ability to identify illusions in model output, and thus improve the reliability of the constructed water conservancy knowledge graph.
[0087] In some embodiments, a two-way closed-loop feedback mechanism is constructed between the large language model and the knowledge graph embedding model based on the structural rationality score, including: performing multi-partition verification on the distribution information of the structural rationality scores corresponding to the triple information of the current batch to determine the high score threshold and the low score threshold; dividing the score interval into a preset acceptance interval, a preset feedback interval, and a preset rejection interval based on the high score threshold and the low score threshold; and removing the initial triple information from the triple information of the current batch when the structural rationality score is in the preset rejection interval.
[0088] In this embodiment, distribution information refers to the overall score statistical pattern (such as percentile distribution) of all triples processed in the current batch after being scored by the knowledge graph embedding model.
[0089] In this embodiment, multi-partition verification (i.e., three-partition routing strategy) is an adaptive data diversion mechanism to address the dynamic drift of scores during model iteration.
[0090] In this embodiment, the high score threshold and the low score threshold are cutting lines dynamically calculated based on the actual distribution of each batch of data. The high score threshold can be 70% percentile and the low score threshold can be 25%.
[0091] In this embodiment, the preset acceptance interval is the score range above the high score threshold, representing an extremely reasonable structure; the preset feedback interval is the score range between the high and low thresholds, representing doubts that need to be corrected; the preset rejection interval is the score range below the low score threshold, representing serious logical conflicts or absurd illusions produced by the large model; removing the initial triplet information means directly discarding the data that falls into the rejection interval, thereby preventing erroneous knowledge from polluting the graph.
[0092] This embodiment constructs a two-way closed-loop feedback mechanism between the large language model and the knowledge graph embedding model through the following: (a) Dynamic threshold generation; Since the score distribution will dynamically drift with each iteration, this embodiment sets a dynamic threshold based on the percentile score of the current batch of triples: ; ; (a) Routing rules for three zones (accept interval, preset feedback interval, and preset rejection interval) are set as follows: .
[0093] For example, the system is currently processing 1000 initial triplets extracted from the scheduling and operation logs of a river basin during the dry season. After the knowledge graph embedding model scores this batch of data, the system statistically analyzes the distribution of the scores, calculating that the 70th percentile (high score threshold) of the current batch is 0.82 and the 25th percentile (low score threshold) is 0.3. Based on this, the system performs multi-partition verification, classifying scores greater than 0.82 into a preset acceptance interval, scores between 0.35 and 0.82 into a preset feedback interval, and scores less than 0.35 into a preset feedback interval. A preset rejection interval was established. At this point, the large model extracted a triplet that seriously violated common sense in water conservancy (downstream C power station, control, upstream A power station water level). The embedded model calculation found that its rotation distance in complex space was extremely large, and it gave a structural rationality score of only 0.12. Since 0.12 falls into the preset rejection interval of less than 0.35, the system judged that the triplet was a serious model illusion and directly triggered the discard action, removing the initial triplet information from the triplet information of the current batch, and no longer handing it over to the large language model for re-inference and error correction.
[0094] The water resources knowledge graph construction method provided in this invention introduces a multi-partition verification mechanism that dynamically generates thresholds based on the current batch score distribution. This mechanism can adapt to the score drift phenomenon that occurs during continuous fine-tuning and iteration of the model. At the same time, by setting a preset rejection interval to remove phantom data, the computational cost of the model is reduced, and efficient alignment of semantic features and structural features is achieved, further improving the quality of the water resources knowledge graph.
[0095] Figure 2 This is the second flowchart of the water conservancy knowledge graph construction method provided by this invention. Figure 2In the illustrated embodiment, textual corpus data is extracted from a corpus database, and hierarchical knowledge extraction is performed. This process includes the following steps: document segmentation and preprocessing, joint extraction format definition, prompt word-driven hierarchical classification, external relation remapping, and outputting reliable triples (hrt); complex space structure verification is performed on the reliable triples, and the following steps are executed: rotation scoring function, semantically guided entity cold start initialization, and outputting structure rationality score; based on the structure rationality score, a bidirectional closed-loop feedback mechanism (corresponding to a bidirectional collaborative feedback mechanism) is constructed between the large language model and the knowledge graph embedding model, and the following steps are executed: dynamic threshold generation, three-part routing rules, and based on the three-part routing rules, The following branching processes are performed: Channel 1: Evidence-guided CoT correction (KGE->LLM); Channel 2: Verification triple integration (LLM->KGE). Simultaneously, the multi-objective constraint module performs the following processing on the data streams received from the "hierarchical knowledge extraction" and "bidirectional collaborative feedback mechanism": constraint consistency verification, iterative convergence, and graph generation. The output data is then reprocessed by the bidirectional collaborative feedback mechanism, ultimately constructing a water resources knowledge graph from the multiple sets of high-confidence triple information. "Accept" indicates multiple sets of high-confidence triple information; "Feedback" indicates a return to the multi-objective constraint module; "Reject" indicates the removal of the current triple information.
[0096] The water conservancy knowledge graph construction device provided by the present invention is described below. The water conservancy knowledge graph construction device described below and the water conservancy knowledge graph construction method described above can be referred to in correspondence.
[0097] Figure 3 This is a schematic diagram of the structure of the water conservancy knowledge graph construction device provided by the present invention, as shown in the figure. Figure 3 As shown, the device includes: a knowledge extraction module 310, a structural rationality scoring module 320, a feedback module 330, and a graph construction module 340.
[0098] The knowledge extraction module 310 is used to extract knowledge from unstructured text in the water conservancy field using a large language model and a preset ontology model, and to obtain initial triplet information and corresponding original text evidence information. The structural rationality scoring module 320 is used to score the structural rationality of the initial triplet information using a knowledge graph embedding model, and obtain a structural rationality score. Feedback module 330 is used to construct a two-way closed-loop feedback mechanism between the large language model and the knowledge graph embedding model based on the structural rationality score; the two-way closed-loop feedback mechanism includes: When the structural rationality score is within a preset feedback range, the large language model is driven to perform reasoning and error correction based on the structural diagnostic signals generated by the knowledge graph embedding model and the original text evidence information, and the obtained triple information is used as high-confidence triple information; when the structural rationality score is within a preset acceptance range, the triple information corresponding to the structural rationality score is determined as high-confidence triple information; the knowledge graph embedding model is incrementally updated based on the high-confidence triple information; The graph construction module 340 is used to repeatedly execute the bidirectional closed-loop feedback mechanism. When the bidirectional closed-loop feedback mechanism meets the preset convergence conditions, it constructs a water conservancy knowledge graph based on the high-confidence triple information output by each iteration.
[0099] The water conservancy knowledge graph construction device provided in this invention achieves hierarchical preliminary knowledge extraction by jointly extracting unstructured text in the water conservancy field using a large language model and a preset ontology model. It uses a knowledge graph embedding model to perform a global consistency check on the initial triplet information, quantifying the risk of illusions or factual errors in the triples. By constructing dynamic partitioning routing rules, a bidirectional information flow is established between the large language model and the knowledge graph embedding model. This allows for structure-guided semantic error correction and optimization of the structural model using high-quality data after error correction, overcoming the limitations of a single model in handling complex water conservancy logic, especially low-frequency long-tail relationships. Finally, through iterative and convergence mechanisms, it achieves dynamic alignment and continuous evolution of semantic and structural features in a unified space, improving the accuracy and structural stability of extracting complex water conservancy professional knowledge.
[0100] Figure 4 An example is a schematic diagram of the physical structure of an electronic device, such as... Figure 4As shown, the electronic device may include: a processor 410, a communication interface 420, a memory 430, and a communication bus 440, wherein the processor 410, the communication interface 420, and the memory 430 communicate with each other through the communication bus 440. The processor 410 can call logical instructions in the memory 430 to execute a water conservancy knowledge graph construction method. This method includes: extracting knowledge from unstructured text in the water conservancy field using a large language model and a preset ontology model to obtain initial triplet information and corresponding original text evidence information; scoring the structural rationality of the initial triplet information using a knowledge graph embedding model to obtain a structural rationality score; and constructing a two-way closed-loop feedback mechanism between the large language model and the knowledge graph embedding model based on the structural rationality score. The two-way closed-loop feedback mechanism includes: when the structural rationality score is within a preset feedback range... In this case, the structural diagnostic signals generated by the knowledge graph embedding model and the original text evidence information drive the large language model to perform reasoning and error correction, and the obtained triple information is used as high-confidence triple information; when the structural rationality score is within the preset acceptance range, the triple information corresponding to the structural rationality score is determined as high-confidence triple information; the knowledge graph embedding model is incrementally updated based on the high-confidence triple information; a bidirectional closed-loop feedback mechanism is executed iteratively, and when the bidirectional closed-loop feedback mechanism meets the preset convergence condition, a water conservancy knowledge graph is constructed based on the high-confidence triple information output by each iteration.
[0101] Furthermore, the logical instructions in the aforementioned memory 430 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0102] On the other hand, the present invention also provides a non-transitory computer-readable storage medium storing a computer program thereon. When executed by a processor, the computer program implements the water conservancy knowledge graph construction method provided by the above methods. This method includes: extracting knowledge from unstructured text in the water conservancy field using a large language model and a pre-defined ontology model to obtain initial triplet information and corresponding original text evidence information; scoring the structural rationality of the initial triplet information using a knowledge graph embedding model to obtain a structural rationality score; and constructing a bidirectional closed-loop feedback mechanism between the large language model and the knowledge graph embedding model based on the structural rationality score. The bidirectional closed-loop feedback mechanism includes: When the structural rationality score is within a preset feedback range, the large language model is driven to perform reasoning and error correction based on the structural diagnostic signals generated by the knowledge graph embedding model and the original text evidence information, and the obtained triple information is used as high-confidence triple information. When the structural rationality score is within a preset acceptance range, the triple information corresponding to the structural rationality score is determined as high-confidence triple information. The knowledge graph embedding model is incrementally updated based on the high-confidence triple information. The bidirectional closed-loop feedback mechanism is executed cyclically. When the bidirectional closed-loop feedback mechanism meets the preset convergence condition, a water conservancy knowledge graph is constructed based on the high-confidence triple information output by each iteration.
[0103] Furthermore, the present invention also provides a computer program product, comprising a computer program that can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the water conservancy knowledge graph construction method provided by the above methods. This method includes: extracting knowledge from unstructured text in the water conservancy field using a large language model and a preset ontology model to obtain initial triple information and corresponding original text evidence information; scoring the structural rationality of the initial triple information using a knowledge graph embedding model to obtain a structural rationality score; and constructing a bidirectional closed-loop feedback mechanism between the large language model and the knowledge graph embedding model based on the structural rationality score. The feedback mechanism includes a two-way closed-loop feedback mechanism: when the structural rationality score is within a preset feedback range, the large language model is driven to perform reasoning and error correction based on the structural diagnostic signals generated by the knowledge graph embedding model and the original text evidence information, and the obtained triple information is used as high-confidence triple information; when the structural rationality score is within a preset acceptance range, the triple information corresponding to the structural rationality score is determined as high-confidence triple information; the knowledge graph embedding model is incrementally updated based on the high-confidence triple information; the two-way closed-loop feedback mechanism is executed iteratively, and when the two-way closed-loop feedback mechanism meets the preset convergence condition, a water conservancy knowledge graph is constructed based on the high-confidence triple information output in each iteration.
[0104] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.
[0105] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.
[0106] 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 them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for constructing a water conservancy knowledge graph, characterized in that, include: Knowledge extraction is performed on unstructured texts in the water conservancy field using a large language model and a pre-defined ontology model to obtain initial triple information and corresponding original text evidence information; The rationality of the structure of the initial triplet information is scored using a knowledge graph embedding model to obtain a structural rationality score; Based on the structural rationality score, a two-way closed-loop feedback mechanism is constructed between the large language model and the knowledge graph embedding model; the two-way closed-loop feedback mechanism includes: When the structural rationality score is within the preset feedback range, the large language model is driven to perform reasoning and error correction based on the structural diagnostic signal generated by the knowledge graph embedding model and the original text evidence information, and the obtained triplet information is used as high-confidence triplet information. If the structural rationality score is within a preset acceptance range, the triple information corresponding to the structural rationality score is determined as the high-confidence triple information; the knowledge graph embedding model is incrementally updated based on the high-confidence triple information. The bidirectional closed-loop feedback mechanism is executed cyclically. When the bidirectional closed-loop feedback mechanism meets the preset convergence condition, a water conservancy knowledge graph is constructed based on the high-confidence triplet information output in each cycle.
2. The method for constructing a water conservancy knowledge graph according to claim 1, characterized in that, The preset ontology model also includes category information and hierarchical relationships of different entities; The method involves using a large language model and a pre-defined ontology model to extract knowledge from unstructured text in the water conservancy field, obtaining initial triplet information and corresponding original text evidence information, including: Based on the hierarchical relationship and the category information, a set of coarse-grained categories and a subset of fine-grained relationships associated with each coarse-grained category are determined. The large language model is used to extract entity pairs from the unstructured text, and the target coarse-grained category to which the entity pair belongs is predicted in the coarse-grained category set. The output space of the large language model is constrained to a subset of target fine-grained relations associated with the target coarse-grained categories, and the large language model is driven to extract the target fine-grained relations between entity pairs in the subset of target fine-grained relations. The initial triplet information and the original text evidence information are generated based on the entity pairs, the target fine-grained relationships, and the corresponding text fragments in the unstructured text.
3. The method for constructing a water conservancy knowledge graph according to claim 1, characterized in that, The method of using a knowledge graph embedding model to score the structural rationality of the initial triplet information yields a structural rationality score, including: Calculate the semantic feature vector of the unseen entity in the initial triplet information; The semantic feature vector is mapped to the complex vector space corresponding to the knowledge graph embedding model using a preset linear projection matrix to obtain the initial representation of the unseen entity; The initial triple information is updated using the initialization representation, and the rationality of the structure of the updated triple information is scored using the knowledge graph embedding model to obtain the structural rationality score.
4. The method for constructing a water conservancy knowledge graph according to claim 3, characterized in that, The updated triplet information includes a head entity, a relation, and a tail entity, wherein the relation represents a rotation operation from the head entity to the tail entity in the complex vector space. The step of using the knowledge graph embedding model to score the structural rationality of the updated triplet information, resulting in a structural rationality score, includes: Obtain the complex vector representations of the head entity, the relation, and the tail entity in the complex vector space; Calculate the element-wise product between the complex vector representation of the head entity and the complex vector representation of the relation, and calculate the distance difference score between the element-wise product and the complex vector representation of the tail entity to obtain the structural rationality score.
5. The method for constructing a water conservancy knowledge graph according to claim 1, characterized in that, The preset ontology model includes domain constraint information corresponding to different entities; After obtaining the initial triplet information and the corresponding original text evidence information, the method further includes: Based on the domain constraint information, the initial triplet information is subjected to multi-objective condition constraint consistency verification, wherein the multi-objective condition constraints include flood control constraints, power generation constraints, and ecological constraints with a preset priority order. If the initial triplet information satisfies the consistency of multi-objective constraints, the rationality of the structure of the initial triplet information is scored using the knowledge graph embedding model to obtain the structural rationality score.
6. The method for constructing a water conservancy knowledge graph according to claim 1, characterized in that, The bidirectional closed-loop feedback mechanism for constructing the large language model and the knowledge graph embedding model based on the structural rationality score includes: Multi-partition verification is performed on the distribution information of the structural rationality scores corresponding to the triplet information of the current batch to determine the high score threshold and low score threshold; Based on the high score threshold and the low score threshold, the scoring interval is divided into the preset acceptance interval, the preset feedback interval, and the preset rejection interval; If the structural rationality score is within the preset rejection range, the initial triplet information is removed from the triplet information of the current batch.
7. A device for constructing a water conservancy knowledge graph, characterized in that, include: The knowledge extraction module is used to extract knowledge from unstructured text in the water conservancy field using a large language model and a preset ontology model, to obtain initial triple information and corresponding original text evidence information. The structural rationality scoring module is used to score the structural rationality of the initial triplet information using a knowledge graph embedding model, and obtain a structural rationality score. The feedback module is used to construct a two-way closed-loop feedback mechanism between the large language model and the knowledge graph embedding model based on the structural rationality score; the two-way closed-loop feedback mechanism includes: When the structural rationality score is within a preset feedback range, the large language model is driven to perform reasoning and error correction based on the structural diagnostic signal generated by the knowledge graph embedding model and the original text evidence information, and the obtained triple information is used as high-confidence triple information; when the structural rationality score is within a preset acceptance range, the triple information corresponding to the structural rationality score is determined as the high-confidence triple information; the knowledge graph embedding model is incrementally updated based on the high-confidence triple information; The graph construction module is used to repeatedly execute the bidirectional closed-loop feedback mechanism. When the bidirectional closed-loop feedback mechanism meets the preset convergence condition, it constructs a water conservancy knowledge graph based on the high-confidence triplet information output in each cycle.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that, When the processor executes the computer program, it implements the water conservancy knowledge graph construction method as described in any one of claims 1 to 6.
9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the water conservancy knowledge graph construction method as described in any one of claims 1 to 6.
10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the water conservancy knowledge graph construction method as described in any one of claims 1 to 6.