Reservoir emergency plan big language model review method fusing knowledge graph
By integrating knowledge graphs and large language models, a structured reservoir emergency plan review method is constructed, which solves the problem of inaccurate understanding of large language models in reservoir emergency plan review, and achieves efficient and reliable intelligent review.
Patent Information
- Application Number
- CN202510929291.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-07
- Publication Date
- 2025-08-01
- Estimated Expiration
- 2045-07-07
AI Technical Summary
The existing large language model is difficult to accurately understand engineering terms, timing responses and constraints in the review of reservoir emergency plans, resulting in uncertainty and inconsistency in the inference results and cannot meet the high-standard risk control requirements.
Integrate knowledge graphs and large language models, build structured knowledge graphs to enhance semantic understanding ability, use graph attention mechanisms and two-way reinforcement mechanisms to optimize the model, and combine multimodal data for review.
A comprehensive and intelligent analysis of reservoir emergency plans has been achieved, the accuracy and efficiency of the review have been improved, and the interpretability and reliability of the review results have been enhanced.
Smart Images

Figure CN120407756A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of natural language processing, and specifically provides a large language model review method for reservoir emergency plans integrating knowledge graphs. Background Art
[0002] In the safety management of water conservancy projects, reservoir emergency plans play an important role in guiding emergency response and risk disposal. With the continuous improvement of the requirements for plan preparation and implementation, the content covered by the plan becomes more complex and diverse. Manual review methods face challenges in terms of efficiency, comprehensiveness, and professional consistency, and it is difficult to meet the needs of modern projects for efficient and intelligent review.
[0003] The wide application of large language models in natural language processing tasks provides a new idea for intelligent review of emergency plans. They have certain capabilities in text understanding, semantic matching, etc., and can assist in identifying semantic inconsistencies, logical jumps, etc. in the plan. However, since emergency plans are highly specialized technical documents, relying solely on the general semantic capabilities of language models is prone to problems such as unclear understanding of key concepts and broken reasoning chains, and it is difficult to support the high-standard review requirements for risk control texts.
[0004] In the absence of structured professional knowledge support, such models often have difficulty accurately parsing core elements such as engineering terms, timing responses, and constraint conditions, resulting in uncertainty and incoherence in their reasoning results, affecting the reliability of practical applications and the interpretability of review results. To enhance the semantic understanding and logical reasoning capabilities of large language models in professional scenarios, introducing structured knowledge support has become a key direction.
[0005] Therefore, a large language model review method for reservoir emergency plans integrating knowledge graphs is proposed. The knowledge graph can model elements such as reservoir operation rules, historical cases, risk types, and response strategies into an explicit semantic relationship network, providing a traceable and inferable knowledge basis for intelligent systems. Summary of the Invention
[0006] The object of the present invention is to provide a large language model review method for reservoir emergency plans integrating knowledge graphs to automatically analyze the integrity and rationality of reservoir emergency plans. The specific process includes extracting core entity, relationship, and attribute information from the reservoir emergency plan to be reviewed, constructing a structured knowledge graph, and feature encoding the entities and relationships in the graph through graph attention mechanisms. Optimize the large language model through contrastive learning to enhance its semantic understanding ability, and combine with a bidirectional reinforcement mechanism to optimize the model's feedback on knowledge graph information and improve the accuracy of plan review. In addition, the review report generated by the large language model can automatically identify potential risk points, detect inconsistent and ambiguous expressions, thereby improving the efficiency and intelligent level of reservoir emergency plan review.
[0007] To achieve the above object, the present invention provides the following technical solutions:
[0008] A method for reviewing a large language model of a reservoir emergency plan integrating a knowledge graph, comprising:
[0009] Obtain the reservoir emergency plan to be reviewed and perform data structuring processing;
[0010] Use the first neural network model to learn core semantic concepts and association patterns from the preprocessed text information, and combine a multi-scale context awareness mechanism to comprehensively capture global semantic information at the local word meaning, intra-sentence structure, and paragraph level, and construct a knowledge graph representation of the reservoir emergency plan text;
[0011] Adopt a second neural network model to perform content understanding and feature learning on the chart-type information in the emergency plan to be reviewed, and construct a multi-modal knowledge graph of the reservoir emergency plan;
[0012] Adopt contrastive learning to fine-tune the open-source large language model of the Transformer architecture, construct a large language model of the reservoir emergency plan, and achieve complementary enhancement of the semantic embedding of the language model and the structural representation of the knowledge graph through a two-way reinforcement mechanism;
[0013] Combine the graph attention mechanism to embed the multi-modal knowledge graph into the fine-tuned large language model for review and generate a review report.
[0014] Preferably, the specific process of the data structuring processing includes cleaning the text data, removing irrelevant characters and special symbols, and at the same time removing stop words; performing word segmentation on the text, disassembling it into basic language units, and performing part-of-speech tagging; performing deduplication operations to eliminate duplicate information and performing denoising processing.
[0015] Preferably, the core semantic concepts and association patterns include core entities, entity attribute representations, and semantic association patterns; the core entities include reservoir project entities, emergency event entities, emergency response entities, environment and meteorology entities, and relevant personnel entities, covering the key elements involved in the reservoir emergency plan. The reservoir project entity represents the reservoir itself and the equipment and structures related to the reservoir; the emergency event entity involves possible emergencies; the emergency response entity includes emergency response measures and action plans, mainly describing the response measures taken in an emergency; the environment and meteorology entity focuses on the impact of the external environment and meteorological conditions on the operation of the reservoir, especially extreme climate events; the relevant personnel entity involves all personnel roles and responsibilities participating in the emergency response;
[0016] The entity attribute representations include reservoir project attributes, emergency event attributes, emergency response attributes, and environmental event attributes, which are used to describe the specific characteristics of each core entity;
[0017] The semantic association patterns described above include engineering status monitoring, event impact, response scheduling, environmental association, and personnel responsibilities, etc., which describe the interconnections and interactions among various core entities.
[0018] Preferably, the multi-scale context awareness mechanism identifies core semantic concepts and their association patterns through a first neural network model. By introducing the multi-scale context awareness mechanism, multi-scale semantic features are constructed through word-level semantic encoding, syntactic structure modeling, and paragraph-level context modeling of the emergency plan, comprehensively capturing local and global semantic information. The feature vectors of the reservoir emergency plan from different scales are projected into a unified dimensional space for alignment. After learning and identifying entities, attributes, and relationships, they are transformed into a triple (entity-relationship-entity) representation form that conforms to the knowledge graph specification, and finally a knowledge graph of the reservoir emergency plan text data is constructed.
[0019] Preferably, constructing the multi-modal knowledge graph of the reservoir emergency plan includes text information extraction, chart-type data modeling, and forming the multi-modal knowledge graph of the reservoir emergency plan; extracting the chart-type data from the reservoir emergency plan to be reviewed, where the chart-type data includes pictures and tables; the chart-type data modeling extracts features from the pictures through a second neural network model, identifies important elements related to the reservoir emergency plan from the pictures, generates labels for each image using image annotation technology, and identifies the entities and relationships therein; processes the tables through the second neural network model, identifies the row and column relationships in the tables, extracts the semantic information of each cell, and analyzes various entities and attributes listed in the tables according to the context; the formation of the reservoir emergency plan knowledge graph is to transform the entity, relationship, and attribute information in the pictures and tables into a triple form (entity-relationship-entity) that conforms to the knowledge graph specification through the second neural network model, and fuse it with the text data processed by the first neural network model to form the multi-modal knowledge graph of the reservoir emergency plan.
[0020] Preferably, the open-source large language model that fine-tunes the Transformer architecture enhances the model's ability to identify subtle differences in the reservoir emergency plan by introducing contrastive learning. The positive sample pairs are coping strategies with similar semantics but different expressions in the same emergency plan, and the negative sample pairs are semantically unrelated segments from different emergency plans. During training, the embedding vectors of the positive sample pairs are pulled closer and the embedding vectors of the negative sample pairs are pushed farther apart through the contrastive loss function InfoNCE, and the parameters are continuously adjusted during the fine-tuning process to optimize the representation space.
[0021] Preferably, the two-way reinforcement mechanism includes a knowledge graph reinforcement module and a context semantic feedback module; the knowledge graph reinforcement module uses a graph neural network (GNN) to extract the relationships, attributes, and interdependencies between entities from the knowledge graph, generates a structured vector representation, and integrates this vector information into the large language model; in each round of training, the output of the large language model is adjusted through the structured information of the knowledge graph to ensure that the model can make full use of the associated knowledge in the graph when generating pre-plan review opinions, thereby improving the model's ability to understand complex semantics; the context semantic feedback module associates and strengthens each part of the reservoir emergency plan text with the surrounding context through dynamic semantic representation generation and self-attention mechanism, and refines and corrects it in combination with the entity and relationship information in the knowledge graph; in each iteration of the two-way reinforcement mechanism, the model is continuously optimized through reinforcement learning to achieve accurate identification of the reservoir emergency plan.
[0022] Preferably, embedding the entity and relationship information in the knowledge graph into the fine-tuned large language model extracts the structured information of entity nodes and relationship edges from the knowledge graph of the reservoir emergency plan, uses the graph attention mechanism to perform parallel calculations through multiple attention heads, performs weighted summation on each node (entity) and its adjacent nodes (relationships), captures the dynamic relationships between nodes, adaptively adjusts the association strength between entities through attention coefficients, and generates embedding vectors; in combination with the self-attention mechanism in the fine-tuned large language model, taking the embedded node and relationship vectors in the graph as inputs, and through the hierarchical processing of the Transformer architecture, further captures the deep semantic structure between entities and relationships.
[0023] Preferably, the review report includes the review time, review object, entity and relationship analysis, and problem identification and suggestions. The review time records the specific date and time of the review, and the review object clarifies the specific version and related content of the reviewed reservoir emergency plan. In the entity and relationship analysis section, the report analyzes the key relationships between the reservoir project, emergency events, and response plans, revealing how they interact and affect the effectiveness of the plan. The problem identification and suggestions section points out the problems in the plan, such as the lack of detailed response steps, insufficient equipment maintenance, and unclear personnel allocation, etc. The report also puts forward improvement suggestions for these problems, such as supplementing detailed emergency response procedures, strengthening regular equipment maintenance, and optimizing personnel scheduling, to improve the practicality and execution efficiency of the plan.
[0024] Compared with the prior art, the beneficial effects of the present invention are as follows:
[0025] 1. The knowledge graph that integrates multi-modal data (text, pictures, and tables) in the present invention realizes all-round information integration and intelligent analysis in the review of reservoir emergency plans. While the first neural network model processes text data, the second neural network model is used to extract key information from pictures and tables, and further construct a multi-modal knowledge graph of reservoir emergency plans. Such multi-modal analysis not only limits the review to the text content, but also can comprehensively cover various information related to emergency events, providing more comprehensive and accurate support for the review results.
[0026] 2. By combining the graph attention mechanism GAT with the large language model of the Transformer architecture, the present invention not only realizes accurate review of emergency plans, but also enhances the semantic understanding ability of each key entity and relationship. The graph attention mechanism encodes the features of entities and relationships in the knowledge graph, and further improves the model's understanding of complex plan content by weighted summation of the dynamic relationships between nodes, ensuring that each round of review can comprehensively and profoundly evaluate the integrity and rationality of the plan.
[0027] 3. The present invention designs a two-way reinforcement mechanism between the knowledge graph and the large language model, which enhances the interpretability of the review results of the emergency plan while improving the accuracy of the review of the reservoir emergency plan. Through the interaction between the context semantic information and the knowledge graph, the model can provide the basis for each review judgment, helping the reviewers understand how the model analyzes the text and identifies potential risk points or inconsistencies. Such interpretability makes the review process more transparent and helps to enhance the trust in the automated review results. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] Figure 1 It is a schematic flowchart of a method for reviewing a large language model of a reservoir emergency plan integrating a knowledge graph provided by the present invention;
[0029] Figure 2 It is a schematic structural diagram of a multi-scale context awareness mechanism provided by the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0030] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
[0031] The present invention provides a method for reviewing a large language model of a reservoir emergency plan integrating a knowledge graph. This method is applied to the field of reviewing reservoir emergency plans. The specific flowchart of the method refers to Figure 1 .
[0032] Example 1
[0033] Please refer to Figure 1 , the present invention provides a large language model review method for reservoir emergency plans integrating knowledge graphs, and the technical solution is as follows:
[0034] Obtain the reservoir emergency plan to be reviewed and perform data structuring processing;
[0035] Use the first neural network model to learn the core semantic concepts and association patterns from the preprocessed text information, and combine the multi-scale context awareness mechanism to comprehensively capture the local word meanings, intra-sentence structures, and global semantic information at the paragraph level, and construct a knowledge graph representation of the reservoir emergency plan text;
[0036] Adopt the second neural network model to perform content understanding and feature learning on the chart-type information in the emergency plan to be reviewed, and construct a multi-modal knowledge graph of the reservoir emergency plan;
[0037] Adopt contrastive learning to fine-tune the open-source large language model of the Transformer architecture, construct a large language model for the reservoir emergency plan, and achieve complementary enhancement of the semantic embedding of the language model and the structural representation of the knowledge graph through a two-way reinforcement mechanism;
[0038] Combine the graph attention mechanism to embed the multi-modal knowledge graph into the fine-tuned large language model for review and generate a review report.
[0039] Specifically, the preprocessing of the reservoir emergency plan to be reviewed includes cleaning the text data, removing irrelevant characters and special symbols, and at the same time removing stop words; performing word segmentation on the text, disassembling it into basic language units, and performing part-of-speech tagging; performing deduplication operations to eliminate duplicate information and perform denoising processing.
[0040] In this embodiment, the reservoir emergency plan to be reviewed is preprocessed, including cleaning the text data, removing irrelevant characters and stop words, performing word segmentation and part-of-speech tagging, eliminating duplicate information and denoising. These steps are aimed at improving the data quality and providing accurate input for subsequent entity recognition and knowledge graph construction.
[0041] Furthermore, the core semantic concepts and association patterns include core entities, entity attribute representations, and semantic association patterns; the core entities include reservoir project entities, emergency event entities, emergency response entities, environment and meteorology entities, and relevant personnel entities; the attribute information includes reservoir project attributes, emergency event attributes, emergency response attributes, and environmental event attributes; the relationship information includes engineering status monitoring, event impact, response scheduling, environmental association, and personnel responsibilities.
[0042] In this embodiment, the reservoir project entity refers to the reservoir project itself and its affiliated physical facilities that need to be concerned in emergency management, including dams, spillways, water conveyance tunnels, gates, monitoring stations, backup power supplies, warehouses, roads, and bridges; the emergency event entity refers to various emergencies or disasters that may pose a threat to the safe operation of the reservoir or the downstream area, including floods exceeding the standard, earthquakes, landslides, equipment failures, water pollution, droughts, and ice jams; the emergency response entity refers to the various measures, actions, resources, and mechanisms taken to respond to emergencies, including early warning issuance, personnel evacuation, rescue teams, emergency supplies, emergency plans, emergency communications, medical assistance, traffic control, and post-disaster recovery; the environment and meteorology entity refers to the natural environmental factors and meteorological conditions that affect reservoir operation and emergency decision-making, including rainfall, water level, wind speed, air temperature, soil moisture, reservoir storage capacity, inflow rate, outflow rate, downstream river channel, and protected area; the relevant personnel entity refers to various organizations, positions, and personnel involved in the emergency response process, including the general commander, deputy commanders, members of the expert group, rescue team members, monitoring personnel, information liaison officers, and affected people.
[0043] The reservoir project attributes include dam attributes, gate attributes, monitoring station attributes, and warehouse attributes; the emergency event attributes include flood attributes exceeding the standard, earthquake attributes, and equipment failure attributes; the emergency response attributes include early warning issuance attributes, personnel evacuation attributes, emergency supply attributes, and rescue team attributes; the environment and meteorology attributes include rainfall attributes, water level attributes, and inflow rate attributes.
[0044] The relationship information includes project status monitoring, event impact, response scheduling, environmental association, and personnel responsibilities.
[0045] In this embodiment, the core entities, attributes, and relationships of the reservoir emergency plan are carefully divided, improving the accuracy and integrity of knowledge representation, and laying a solid foundation for the subsequent neural network module to efficiently and accurately extract information. This refined structure not only optimizes the usability of the knowledge graph, facilitates effective encoding by the graph attention mechanism, provides richer and more structured domain knowledge for the construction of the knowledge graph and large language models, enabling deeper semantic understanding and logical reasoning.
[0046] Furthermore, for the specific structure of the multi-scale context awareness mechanism, please refer to Figure 2, a bidirectional long short-term memory network - conditional random field (BiLSTM-CRF) is used to model the context. Specifically, the BiLSTM consists of a forward and a backward LSTM. The forward LSTM models the context information before the current time step from start to end, and the backward LSTM models the context information after the current time step from end to start. By concatenating the hidden states in both directions, a representation containing the global semantics of the context at each time step is obtained. The context representation output by the BiLSTM is mapped to the label space, and a corresponding structural or semantic label is predicted for each time step. On the basis of the BiLSTM, a conditional random field CRF layer is added to jointly model the entire label sequence, considering the dependencies between adjacent labels. By maximizing the path probability, it is ensured that the output label sequence is consistent and legal in semantic logic. On this basis, the core semantic concepts and associated patterns are identified, and a multi-scale context awareness mechanism is introduced. Multi-scale semantic features are constructed by word-level semantic encoding, syntactic structure modeling, and paragraph-level context modeling of the emergency plan, comprehensively capturing local and global semantic information. The feature vectors of the reservoir emergency plan from different scales are projected and mapped into the same-dimensional space for alignment. The model further learns and identifies the core entities, attributes, and relationships between entities in the text, such as reservoir projects, emergency events, emergency response plans, etc., and identifies relationships such as engineering status monitoring, event impacts, response scheduling, etc., as well as attribute information such as names, types, locations, occurrence times, severity levels, implementation steps, personnel allocations, etc. The identified entity, relationship, and attribute information are deeply integrated. Each core entity is used as a node in the knowledge graph, and the relationship between entities or the attributes possessed by entities are used as directed edges connecting the nodes or the characteristics of the nodes themselves. In this way, a series of standardized knowledge triples (entity - relationship - entity) are formed, transformed into structured data and stored in the graph database, and finally a knowledge graph of the text reservoir emergency plan is constructed.
[0047] In this embodiment, the multi-scale context awareness mechanism can comprehensively capture the association between local details and global context in the text by fusing word-level, syntactic structure, and paragraph-level semantic information, improving the ability to understand complex semantic relationships. This mechanism effectively alleviates the problem of information loss that may be caused by single-scale modeling, enhances the sensitivity and expressiveness of the model to multi-level semantic features, thereby significantly improving the accuracy of entity recognition and relationship extraction and the integrity of knowledge graph construction, ensuring that the key information in the reservoir emergency plan text is comprehensively and accurately structured and expressed.
[0048] Furthermore, the construction of the multi-modal knowledge graph for the reservoir emergency plan includes the extraction of chart-type data, the modeling of chart-type data, and the formation of the multi-modal knowledge graph for the reservoir emergency plan; extracting the chart-type data from the reservoir emergency plan to be reviewed, where the chart-type data includes pictures and tables, the pictures contain the structure diagram of the reservoir project and the emergency response flow chart, and the tables show the specific operation steps, equipment list, and personnel arrangement in the reservoir emergency plan; the non-text information modeling extracts features from the pictures through a second neural network model, identifies important elements related to the reservoir emergency plan from the pictures, generates labels for each image using image annotation technology, and identifies the entities and relationships therein; processes the tables through the second neural network model, identifies the row-column relationships in the tables, extracts the semantic information of each cell, and analyzes various entities and attributes listed in the tables according to the context; the formation of the complete reservoir emergency plan knowledge graph is to convert the entity, relationship, and attribute information in the pictures and tables into a triple form (entity-relationship-entity) that conforms to the knowledge graph specification through the second neural network model, and fuse it with the text data processed by the first neural network model to form a complete reservoir emergency plan knowledge graph.
[0049] In this embodiment, a complete reservoir emergency plan knowledge graph is constructed through a multi-scale up-and-down perception mechanism, realizing the comprehensive intelligent management of the reservoir emergency plan. This process not only extracts the core information in the text data but also further improves the integrity and accuracy of the graph through the integration of non-text information. By extracting the key information in the pictures and tables and combining the processing of the images and tables by the second neural network model, it is possible to efficiently identify the structure of the reservoir project, the emergency response process, the operation steps, etc., ensuring that important information is not omitted. Converting this information into triples that conform to the knowledge graph standard facilitates subsequent querying, analysis, and intelligent reasoning. The advantage of this method is that it improves the automation review efficiency of the reservoir emergency plan, reduces manual intervention, can timely detect potential problems, enhances the response speed and accuracy of emergency management, and thus strengthens the execution and safety of the reservoir emergency plan.
[0050] Furthermore, by introducing contrastive learning to fine-tune the open-source large language model of the Transformer architecture, the model's ability to identify subtle differences in the reservoir emergency plan is enhanced. Extract a set of text fragments from the reservoir emergency plan, where these fragments include different coping strategies expressed in the same emergency plan (as positive sample pairs) and semantically unrelated fragments from different emergency plans (as negative sample pairs). These fragments need to be preprocessed to remove noise and ensure the text quality.
[0051] Positive sample pairs are constructed by selecting paragraphs with similar semantics but different expressions in the same emergency plan, ensuring that they are close in the semantic space. Negative sample pairs are selected from other reservoir emergency plans as fragments with completely unrelated semantics, which should cover different scenarios and contents to ensure that the model can clearly distinguish unrelated contents.
[0052] During the fine-tuning process, the contrastive loss function InfoNCE is adopted. This function optimizes the representation space of the model by calculating the distances between the embedding vectors of positive and negative sample pairs. For positive sample pairs, InfoNCE encourages the model to pull their embedding vectors closer, while for negative sample pairs, it pushes their embedding vectors farther apart. By calculating the cosine similarity of positive and negative sample pairs in the embedding space, the parameters are updated to minimize the loss function.
[0053] Through the backpropagation algorithm, the model continuously adjusts the parameters in the Transformer architecture to optimize the representation of sample pairs. The embedding vectors of positive sample pairs are pulled closer, making the positions of similar contents closer in the vector space; while the embedding vectors of negative samples are pushed farther apart to avoid the interference of semantically unrelated contents. Through multiple training iterations, this process gradually enhances the model's ability to recognize subtle differences in reservoir emergency plans. The fine-tuned model can more accurately identify the key differences in reservoir emergency plans, improve the sensitivity to the details of policy expressions, and thus enhance the accuracy and efficiency of the automated review of emergency plans and the construction of knowledge graphs.
[0054] In this embodiment, by introducing a contrastive learning mechanism to fine-tune the open-source large language model with the Transformer architecture, its ability to recognize subtle differences in reservoir emergency plans is enhanced. During the training process, the model constructs positive and negative sample pairs. The positive sample pairs are strategies with different expressions but similar semantics in the same emergency plan, and the negative sample pairs are semantically unrelated fragments from different emergency plans. Using the contrastive loss function, the model pulls the vectors of positive sample pairs closer and pushes the vectors of negative sample pairs farther apart in the embedding space, optimizing the representation space and enabling the model to more accurately distinguish subtle differences in emergency plans. During the fine-tuning process, the model adjusts the parameters through multiple rounds of iteration, improving its ability to recognize key details in reservoir emergency plans. The fine-tuned model can effectively support the automated review of emergency plans and the construction of knowledge graphs, ensuring its high efficiency and accuracy in complex scenarios.
[0055] Furthermore, the bidirectional reinforcement mechanism includes a knowledge graph reinforcement module and a context semantic feedback module; the knowledge graph reinforcement module uses a graph neural network (GNN) to extract the relationships, attributes, and interdependencies between entities from the knowledge graph, generates structured vector representations, and integrates this vector information into the large language model; in each round of training, the output of the large language model is adjusted through the structured information of the knowledge graph to ensure that the model can make full use of the associated knowledge in the graph when generating pre - plan review opinions, thereby improving the model's ability to understand complex semantics; the context semantic feedback module associates and strengthens each part of the reservoir emergency plan text with the surrounding context through dynamic semantic representation generation and self - attention mechanism, and refines and corrects it in combination with the entity and relationship information in the knowledge graph; in each iteration of the bidirectional reinforcement mechanism, the model is continuously optimized through reinforcement learning to achieve accurate recognition of the reservoir emergency plan.
[0056] In this embodiment, the bidirectional reinforcement mechanism is used to optimize the reservoir emergency plan review process. The large language model extracts the context semantic information of the text, generates semantic representations, introduces entity, relationship, and attribute information from the knowledge graph, and enhances the model's understanding of the text; in each iteration, through the interaction of context semantic information and the knowledge graph, the model continuously optimizes the recognition of details, improves the review accuracy, and adjusts the parameters through the reinforcement learning mechanism to ensure the efficiency and accuracy of the review results.
[0057] Preferably, embedding the entity and relationship information in the knowledge graph into the fine - tuned large language model is achieved through the graph attention mechanism (GAT). First, the graph attention mechanism (GAT) uses multi - head attention to perform feature encoding on the complete knowledge graph, and processes each node (entity) and its adjacent nodes (relationships between entities) in a weighted summation manner to capture the dynamic relationships between nodes. Specifically, for each node, the feature representations of its adjacent nodes are aggregated in a weighted summation manner, and the calculation formula is:
[0058]
[0059] where is the feature representation of the adjacent node at the layer, is the weight matrix at the layer, is the dynamically calculated weight, representing the influence of node on node , is the activation function. The dynamic weight is calculated through the attention mechanism, enabling the model to adaptively adjust the contribution weights of neighbor nodes according to the actual association degree between nodes.
[0060] Through multi - layer stacking, this method can capture neighborhood information at different levels, gradually enhancing the semantic expression ability of nodes. This not only preserves local structural features but also dynamically reflects complex relationship changes between nodes.
[0061] Next, the obtained embedding vectors are fed into the fine - tuned large - language model and further processed by the self - attention mechanism of Transformer. This process can capture the deep semantic structure of entities and relationships in the knowledge graph, combine the context information of the reservoir emergency plan, and generate an accurate review report. Throughout the process, the entity and relationship information of the knowledge graph is effectively integrated, further enhancing the model's understanding and review capabilities of the reservoir emergency plan.
[0062] In this embodiment, through the complementary role of the graph attention mechanism and the self - attention mechanism, the model's understanding ability of the reservoir emergency plan is significantly improved. The knowledge graph provides structured entity and relationship information, helping the model better capture details and context in the text, thus avoiding information loss and understanding deviation in traditional methods. By embedding entities and relationships into the large - language model, the model can be continuously optimized in each iteration, gradually improving the accuracy of the review. This method can not only more accurately identify and process complex emergency plan information but also, through the supplementation of the knowledge graph, make the model more adaptable and robust when dealing with new data, thereby enhancing the reliability and efficiency of the reservoir emergency plan review process.
[0063] Furthermore, analyze the reservoir emergency plan to be reviewed according to the large - language model and output a review report; the review report includes the review time, review object, entity and relationship analysis, and problem identification and suggestions. The review time records the specific date and time of the review, and the review object clarifies the specific version and relevant content of the reservoir emergency plan to be reviewed. In the entity and relationship analysis section, the report analyzes the key relationships between reservoir projects, emergency events, and response plans, revealing how they interact and affect the effectiveness of the plan. The problem identification and suggestions section points out problems in the plan, such as the lack of detailed response steps, insufficient equipment maintenance, and unclear personnel allocation. The report also puts forward improvement suggestions for these problems, such as supplementing detailed emergency response procedures, strengthening regular equipment maintenance, and optimizing personnel scheduling, to improve the practicality and implementation efficiency of the plan.
[0064] In this embodiment, the large language model is used to analyze the reservoir emergency plan to be reviewed, and a detailed review report is generated. The content of the review report includes the review time, review object, entity and relationship analysis, as well as problem identification and improvement suggestions. In the entity and relationship analysis part, the core relationships among the reservoir project, emergency events, and response plans are emphasized, the interactions and dependencies of key entities are identified, and potential risk points are revealed. In the problem identification and suggestion part, based on the model analysis results, the deficiencies in the plan are pointed out, such as the lack of detailed response steps, the absence of equipment maintenance plans, the unclear personnel allocation, etc., and specific improvement measures are given to ensure the operability of the plan and the efficiency of emergency response.
[0065] The present invention automates the review of the reservoir emergency plan through a large language model integrated with a knowledge graph to improve the review efficiency, accuracy, and integrity. During the review process, the model first processes the text data of the reservoir emergency plan to extract the key entities (such as reservoir projects, emergency events, response plans, etc.) and their relationships. Entity recognition is achieved through a deep learning model, combined with the named entity recognition NER technology, to identify the core information in the text; while relationship extraction uses graph convolutional network GCN or other deep learning technologies to capture the complex relationships between entities, such as equipment monitoring, event response, response scheduling, etc.
[0066] In the process of constructing the knowledge graph, entity and relationship information is deeply encoded through the graph attention mechanism GAT to generate embedding vectors of entities and relationships. Specifically, first, each entity and relationship is initialized to a corresponding feature vector, which can be based on pre-trained word vectors or randomly initialized embeddings. Then, GAT updates the node representation by calculating the weighted aggregation of its adjacent nodes (including entities and relationships) for each entity node, and the weights are dynamically calculated by the attention mechanism, reflecting the importance of neighbor nodes to the current node. For a certain entity node, calculate the attention coefficient between it and its neighbor nodes, then multiply the feature vectors of the neighbor nodes by the corresponding attention weights and sum them, and finally, through a non-linear activation function, obtain the new embedding representation of the node. Through multi-layer stacking, GAT can fully integrate the context information of entities and relationships, generate high-quality embedding vectors, and effectively support the reservoir emergency plan review task of the knowledge graph.
[0067] These embedding vectors can not only reflect the semantics of each entity in the reservoir emergency plan but also capture the relevance between them. These vectors are then fed into the fine-tuned large language model, and through the self-attention mechanism of the Transformer architecture, the model's understanding ability of the text and the knowledge graph is further improved, thus providing support for the generation of the review report.
[0068] During the review process, the model adopts a two-way reinforcement mechanism and is optimized through contrastive learning. The selection of positive and negative sample pairs is based on similar segments in the reservoir emergency plan text. During the training process, the model uses the InfoNCE loss function to adjust the similarity of the embedding vectors, narrowing the vector distance of positive sample pairs and widening the vector distance of negative sample pairs, so that the model can identify subtle differences and potential problems in the text.
[0069] Based on the above model, a review report is generated. The content of the report includes: review time, review object, entity and relationship analysis, and problem identification and suggestions. In the entity and relationship analysis section, the model identifies and summarizes the key relationships among reservoir projects, emergency events, and response plans, and analyzes the interactions among various links. In the problem identification and suggestions section, potential problems in the plan are pointed out, such as lack of details in response steps, insufficient equipment maintenance plans, or unclear personnel allocation, etc., and targeted improvement opinions and suggestions are put forward. These review results help to optimize the reservoir emergency plan and improve its emergency response ability and execution efficiency.
[0070] Embodiment 2
[0071] This embodiment provides a specific application of the method for reviewing large language models of reservoir emergency plans integrated with knowledge graphs in the scenario of reviewing reservoir emergency plans. This embodiment takes the emergency plan of Reservoir A in 2024 as a specific scenario for reviewing reservoir emergency plans, and details how the present invention is applied to the review of reservoir emergency plans. The technical solution refers to Figure 1 , specifically as follows:
[0072] Obtain the reservoir emergency plan to be reviewed, and perform cleaning and preprocessing;
[0073] Define the core entity types, machine attributes, and relationships of the reservoir emergency plan, construct the corresponding ontology design, and use the first neural network model to extract entity, relationship, and attribute information from the preprocessed text data to construct a knowledge graph of reservoir emergency plan text data;
[0074] Use the second neural network model to extract information from the non-text information in the emergency plan to be reviewed. The non-text information includes pictures and tables, and convert this information into a form that can be represented by the knowledge graph to construct a complete knowledge graph of the reservoir emergency plan;
[0075] Adopt contrastive learning to fine-tune the open-source large language model with the Transformer architecture to construct a large language model for reservoir emergency plans; design a two-way reinforcement mechanism, and during the training process, convert the context semantic information in the large language model into enhanced feedback on the entities and relationships of the knowledge graph, and at the same time convert the structured knowledge in the knowledge graph into semantic representation supplements for the large language model;
[0076] Combine the graph attention mechanism to perform feature encoding on the emergency plan knowledge graph to be reviewed, embed the entity and relationship information in the knowledge graph into the fine-tuned large language model for review, and generate a review report.
[0077] Specifically, obtain the emergency plan text data file of Reservoir A in 2024 and continue to parse the file, including chapters such as General Provisions of Emergency, Organizational Structure and Responsibilities, Prevention and Early Warning, Emergency Response, and Post-disaster Disposal, with a total of 85 pages. Preprocess the text data, including cleaning, removing irrelevant characters and special symbols, and at the same time removing stop words; perform word segmentation on the text, break it down into basic language units, and perform part-of-speech tagging; perform deduplication operations to eliminate duplicate information and perform denoising processing; obtain table attachment files, including equipment lists, emergency personnel contact lists, and external rescue unit tables, and convert them into JSON format.
[0078] Use the first neural network model, the Bidirectional Long Short-Term Memory-Conditional Random Field (BiLSTM-CRF) model, for text analysis to identify core entities and analyze relationships between entities, including reservoir projects: main dam, spillway gates (a total of 5), Pumping Station 1, emergency power supply room, water level gauges (numbered SG01 - SG05); emergency events: floods exceeding the standard (inflow > 5000 m³ / s), structural deformation of the main dam (threshold: horizontal displacement > 50mm), large-scale power outages, and construct an emergency plan text data knowledge graph; use the second neural network to process pictures and tables, and perform key information extraction and calculation based on the converted JSON format to construct a non-text information knowledge graph.
[0079] Fuse the text data knowledge graph and the chart-type data knowledge graph to construct a complete reservoir emergency plan knowledge graph.
[0080] After the 2024 annual emergency plan of Reservoir A is analyzed in detail through the bidirectional reinforcement mechanism, the model can effectively enhance the understanding of the text content and identify potential problems and deficiencies therein. First, by inputting the text content of the 2024 annual emergency plan of Reservoir A, the model extracts core entities such as reservoir projects, emergency events, and response plans, and further analyzes the relationships between them. For example, the model can identify the associations between facilities such as pumping stations and gates and corresponding emergency events (such as equipment failures and rising water levels caused by heavy rain), revealing the key roles of these facilities during the event and the required emergency response measures.
[0081] Driven by the two-way reinforcement mechanism, the model utilizes entity, relationship, and attribute information in the knowledge graph to not only enhance text semantic understanding but also improve sensitivity to subtle differences through comparative analysis. For example, the model compares parts in the same plan that describe similar emergency response steps (such as equipment inspection procedures and activation steps of the alarm system) to identify possible inconsistent expressions or insufficient details. Through reinforcement learning, the model adjusts the embedded vector space to make the gap between positive and negative sample pairs more obvious, thereby further optimizing the ability to capture subtle differences between different emergency plans and generating review reports.
[0082] The review results indicate that there are several problems in the emergency plan for Reservoir A in 2024. Specifically, the description of emergency response steps for some key equipment is too brief, without providing detailed operation procedures and inspection checklists; the equipment maintenance cycle and personnel arrangements in the table are unclear, and the emergency personnel allocation during peak periods is not fully considered. The model put forward detailed suggestions, requiring the supplementation of specific steps for equipment failure response, the definition of clear personnel responsibility assignments for various emergency events, and the optimization of the equipment inspection cycle to ensure that the reservoir can respond quickly and effectively in various emergency situations.
[0083] Although the embodiments of the present invention have been shown and described, for those of ordinary skill in the art, it can be understood that various changes, modifications, substitutions, and variations can be made to these embodiments without departing from the principles and spirit of the present invention. The scope of the present invention is defined by the appended claims and their equivalents.
Claims
1. A large language model review method for reservoir emergency plans integrating knowledge graphs Comprising, characterized in that: Obtain the reservoir emergency plan to be reviewed and perform data structuring processing; Use the first neural network model to learn the core semantic concepts and association patterns from the preprocessed text information, and combine with the multi-scale context awareness mechanism to comprehensively capture local and global semantic information, and construct the knowledge graph representation of the reservoir emergency plan text; Adopt the second neural network model to perform content understanding and feature learning on the chart-type information in the emergency plan to be reviewed, and construct the multi-modal knowledge graph of the reservoir emergency plan; Adopt contrastive learning to fine-tune the open-source large language model with the Transformer architecture, construct the large language model of the reservoir emergency plan, and achieve complementary enhancement of the semantic embedding of the language model and the structural representation of the knowledge graph through the bidirectional reinforcement mechanism; Combine the graph attention mechanism to embed the multi-modal knowledge graph into the fine-tuned large language model for review and generate a review report.
2. The method for reviewing a large language model of a reservoir emergency plan integrating a knowledge graph according to claim 1, wherein The specific process of the data structuring processing includes: Preprocess the obtained reservoir emergency plan to be reviewed, and the preprocessing process includes word segmentation, part-of-speech tagging, syntactic analysis and entity recognition.
3. A method for reviewing a large language model of a reservoir emergency plan integrating a knowledge graph according to claim 1, characterized in that The core semantic concepts and association patterns include: The core semantic concepts and association patterns include core entities, entity attribute representations and semantic association patterns; The core entities include reservoir project entities, emergency event entities, emergency response entities, environment and meteorological entities and relevant personnel entities; The entity attribute representations include reservoir project attributes, emergency event attributes, emergency response attributes and environmental event attributes; The semantic association patterns include engineering status monitoring, event impact, response scheduling, environmental association and personnel responsibilities.
4. A method for reviewing a large language model of a reservoir emergency plan integrating a knowledge graph according to claim 1, characterized in that, The specific steps of the multi-scale context awareness mechanism are: Use the first neural network model to extract features from the preprocessed emergency plan text data, identify the core semantic concepts and association patterns, introduce the multi-scale context awareness mechanism, and construct multi-scale semantic features through word-level semantic encoding, syntactic structure modeling and paragraph-level context modeling of the emergency plan to comprehensively capture local and global semantic information; Align the feature vectors of the reservoir emergency plan from different scales by projecting them into the same dimensional space; After learning and identifying entities, attributes and relationships, convert them into the triple representation form that conforms to the knowledge graph specification to obtain the text reservoir emergency plan knowledge graph.
5. A method for reviewing a large language model of a reservoir emergency plan integrating a knowledge graph, characterized in that, The process of constructing the multi-modal knowledge graph of the reservoir emergency plan is: Identify and separate all chart-type data from the reservoir emergency plan to be reviewed, and the chart-type data includes pictures and tables; Use the second neural network model to perform feature learning and label generation on the chart-type data; Convert the entities, relationships and attributes learned and identified from the pictures and tables by the second neural network model into the triple representation form that conforms to the knowledge graph specification, and fuse them with the text knowledge graph representation processed by the first neural network model to obtain the multi-modal knowledge graph of the reservoir emergency plan.
6. The method for reviewing a large language model of a reservoir emergency plan integrating a knowledge graph according to claim 1, wherein The specific process of fine-tuning the open-source large language model with the Transformer architecture is: Fine-tune the open-source large language model of the Transformer architecture using contrastive learning, collect reservoir emergency plan texts and related water conservancy specifications and cases to construct training and validation datasets, construct positive sample pairs and negative sample pairs, where the positive sample pairs are coping strategies with similar semantics but different expressions in the same emergency plan, and the negative sample pairs are content segments with unrelated semantics in the emergency plan, and train through the contrastive loss function InfoNCE.
7. A method for reviewing a large language model of a reservoir emergency plan integrating a knowledge graph according to claim 1, characterized in that, The specific process of the two-way reinforcement mechanism is as follows: The two-way reinforcement mechanism realizes the interaction between context semantic information and knowledge graph information. The large language model analyzes the reservoir emergency plan text, extracts context-related semantic information, and generates a deep semantic representation; uses the vector representations of entities, relationships, and attributes in the knowledge graph to enhance the model's context understanding and supplement the details that may be missing in the text.
8. A method for reviewing a large language model of a reservoir emergency plan integrating a knowledge graph according to claim 1, characterized in that, The specific process of embedding the entity and relationship information in the multi-modal knowledge graph into the fine-tuned large language model is as follows: Use the graph attention network GAT to perform node and relationship embedding learning on the constructed reservoir emergency plan multi-modal knowledge graph. By performing weighted summation on each node in the graph and its adjacent nodes, capture the dynamic relationships between nodes, and obtain the embedding vectors of each node and edge in the reservoir emergency plan knowledge graph. Send the embedding vectors into the fine-tuned large language model to be processed by the self-attention mechanism of Transformer, capture the deep semantic structure of entities and relationships in the graph, and generate a review report.
9. The method for reviewing the large language model of the reservoir emergency plan integrating the knowledge graph according to claim 1, characterized in that, The review report includes the review time, review object, entity and relationship analysis, and problem identification and suggestions; The entity and relationship analysis includes the key relationships between reservoir projects, emergency events, and response plans; The problem identification and suggestions point out the problems of lack of detailed response steps, insufficient equipment maintenance, and unclear personnel allocation in the plan, and put forward improvement opinions.
Citation Information
Patent Citations
Multi-modal electric power knowledge graph construction method and device, equipment and storage medium
CN114064926A
Reservoir flood control emergency plan knowledge graph construction method and system
CN118070886A
Embedded hydraulic engineering risk intelligent regulation and control method based on knowledge graph
CN118297381A
Bridge field construction scheme examination method based on large model and knowledge graph
CN118411016A
Construction scheme compliance auditing system and method based on knowledge graph and large model
CN118643168A
Cited By
Airport emergency processing method, device, equipment, storage medium and program product
CN120579834A
Power system data retrieval method and system based on knowledge graph and comparative learning
CN121051137A
Coal mine potential safety hazard management and control method, device, equipment and medium
CN121095044A
A coal mine safety hidden danger management and control method, device, equipment and medium
CN121095044B
Production site potential safety hazard checking method and device
CN121119173A