Tunnel risk reasoning method fusing knowledge graph and large language model
By constructing a fusion method of knowledge graph and large language model, the challenges of multi-source information integration and intelligent reasoning in tunnel monitoring systems are solved, and high-precision tunnel risk early warning is achieved.
Patent Information
- Application Number
- CN202511035387.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-25
- Publication Date
- 2025-11-07
AI Technical Summary
Traditional tunnel monitoring systems lack the ability to integrate multi-source information and make intelligent inferences about complex related events, leading to problems such as delayed warnings, false alarms, or missed warnings.
A method for integrating knowledge graphs and large language models is proposed. Entities and relations are extracted using a BiLSTM-CRF model to generate triples. Natural language prompts are generated by combining sensor data, and risk reasoning is performed using graph embedding algorithms and large language models.
It achieves high-precision and interpretable tunnel risk early warning based on multi-source data, and outputs anomaly type, risk level, and handling suggestions.
Smart Images

Figure CN120911608A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of tunnel monitoring, and particularly relates to a tunnel risk reasoning method fusing a knowledge graph and a large language model. BACKGROUND
[0002] In the monitoring and operation process of tunnel engineering, multi-source information such as structure state, geological changes and construction interference needs to be collected and comprehensively analyzed in real time to realize the identification and early warning of potential risks. The traditional tunnel monitoring system mainly relies on sensor data collection and manual threshold setting, and combines expert experience to make abnormality judgments. However, in actual application, the following challenges still exist: on the one hand, the monitoring data sources are diverse, including sensor time series data, design drawings, inspection reports, accident records and the like, and the semantic heterogeneity and structural complexity of the information make it difficult to systematically integrate and automatically interpret the information; on the other hand, the traditional risk identification method mainly relies on experience rules or model thresholds, and lacks intelligent reasoning ability for complex correlation events, causal relationships and upstream and downstream logic, resulting in problems such as delay, false alarm or missed alarm in early warning.
[0003] With the rapid development of natural language processing technology, especially the knowledge graph and the large language model, the semantic information in the multi-source monitoring data is structured modeled, and the deep language understanding and graph structure reasoning are fused, which provides a new solution for realizing high-precision and interpretable risk early warning. The knowledge graph can effectively represent the multi-dimensional semantic relationship between the tunnel components, monitoring indicators, abnormal types, construction links and accidents; the large language model has strong understanding and generation ability for unstructured text. How to construct a knowledge graph for the tunnel scene and design a fusion mechanism of the graph and the large language model to realize semantic identification, path reasoning and intelligent early warning of risk events has become an important problem to be solved in the current intelligent tunnel monitoring field. SUMMARY
[0004] The present application is carried out in order to solve the above problems, and aims to provide a tunnel risk reasoning method fusing a knowledge graph and a large language model.
[0005] The application provides a tunnel risk reasoning method combining a knowledge graph and a large language model, which has the following characteristics: step S1, obtaining structured monitoring data and unstructured text data, using field standardization and missing value processing on the structured monitoring data to achieve uniform format structured monitoring data, and using sentence division, word segmentation and noise removal processing on the unstructured text data to convert it into unstructured text data in a unified text input format; step S2, using a BiLSTM-CRF model to extract entities from the structured monitoring data and the unstructured text data, and extracting the relationship between entities based on the entity recognition results, using the entities and the relationship between the entities to form basic triples, forming a sub-graph based on the basic triples, and integrating the sub-graph to form a knowledge graph; step S3, combining the sensor data and the corresponding entities in the knowledge graph to generate a natural language prompt, extracting a sub-graph related to the natural language prompt from the knowledge graph, using a graph embedding algorithm to convert the sub-graph into a vector form sub-graph, extracting entities and their relationship paths from the knowledge graph as explicit reasoning clues, and inputting the natural language prompt, the vector form sub-graph and the explicit reasoning clues into a large language model to generate a natural language output.
[0006] In the tunnel risk reasoning method combining the knowledge graph and the large language model provided by the application, the semi-structured data in step S1 can also be preprocessed using the preprocessing methods of the structured monitoring data and the unstructured text data.
[0007] In the tunnel risk reasoning method combining the knowledge graph and the large language model provided by the application, step S2 can include the following sub-steps: step S20, using a BiLSTM-CRF model to perform sequence labeling on the text related to tunnel monitoring, capturing context information through a BiLSTM model, combining CRF structure to optimize the label sequence, identifying entities in the text, and outputting the labeling results, and the objective function is:
[0008]
[0009] Wherein, L is a loss function, N is the number of samples, P(y i |x i ; theta) is the conditional probability when the input x i is given; step S21, based on the entity recognition results, using rule matching and dependency syntax analysis to extract semantic relationships between entities to form basic triples; step S22, integrating the sub-graph, aligning the entities and unifying the semantics through entity similarity calculation, naming normalization and hierarchical completion, simultaneously introducing time labels, spatial topology relationships and logical dependency information to construct a knowledge graph.
[0010] In the tunnel risk reasoning method fusing a knowledge graph and a large language model provided by the application, the performance of the BiLSTM-CRF model can be evaluated by using the four indexes of accuracy, precision, recall and F1 value in step S20.
[0011] In the tunnel risk reasoning method fusing a knowledge graph and a large language model provided by the application, the performance of the BiLSTM-CRF model can be evaluated by using the four indexes of accuracy, precision, recall and F1 value in step S20.
[0012] In the tunnel risk reasoning method fusing a knowledge graph and a large language model provided by the application, the performance of the BiLSTM-CRF model can be evaluated by using the four indexes of accuracy, precision, recall and F1 value in step S20.
[0013] In the tunnel risk reasoning method fusing a knowledge graph and a large language model provided by the application, the performance of the BiLSTM-CRF model can be evaluated by using the four indexes of accuracy, precision, recall and F1 value in step S20.
[0014] In the tunnel risk reasoning method fusing a knowledge graph and a large language model provided by the application, the performance of the BiLSTM-CRF model can be evaluated by using the four indexes of accuracy, precision, recall and F1 value in step S20.
[0015] In the tunnel risk reasoning method fusing a knowledge graph and a large language model provided by the application, the performance of the BiLSTM-CRF model can be evaluated by using the four indexes of accuracy, precision, recall and F1 value in step S20.
[0016] Effects of the application
[0017] The tunnel risk reasoning method integrating knowledge graph and large language model according to the present invention includes: Step S1, acquiring structured monitoring data and unstructured text data; performing field standardization and missing value processing on the structured monitoring data to achieve a unified format of structured monitoring data; and performing sentence segmentation, word segmentation, and noise reduction processing on the unstructured text data to convert it into unstructured text data with a unified text input format; Step S2, extracting entities from the structured monitoring data and unstructured text data using a BiLSTM-CRF model, extracting relationships between entities based on entity recognition results, constructing basic triples using entities and relationships between entities, constructing sub-graphs from the basic triples, and further processing... The subgraphs are integrated to form a knowledge graph; in step S3, a natural language prompt is generated by combining sensor data with the corresponding entities in the knowledge graph. Subgraphs related to the natural language prompt are extracted from the knowledge graph, and the subgraphs are transformed into vector form using a graph embedding algorithm. Entities and their relationship paths are extracted from the knowledge graph as explicit reasoning clues. The natural language prompt, the vector form of the subgraphs, and the explicit reasoning clues are input into the large language model to generate natural language output. Therefore, the tunnel risk reasoning method of the present invention, which integrates knowledge graph and large language model, can integrate multi-source data information and output high-precision, interpretable tunnel risk warnings using the large language model. Attached Figure Description
[0018] Figure 1 This is a flowchart illustrating the tunnel risk reasoning method that integrates knowledge graphs and large language models in an embodiment of the present invention.
[0019] Figure 2 This is a schematic diagram of the structure of the BiLSTM-CRF model in an embodiment of the present invention.
[0020] Figure 3 This is a schematic diagram of the classification and extraction process in an embodiment of the present invention.
[0021] Figure 4 This is a schematic diagram of the non-classification extraction process in an embodiment of the present invention. Detailed Implementation
[0022] In the description of this application, it should be noted that, unless otherwise expressly specified and limited, the terms "installation," "connection," and "linking" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection, an electrical connection, or a connection that allows communication between them; they can refer to a direct connection or an indirect connection through an intermediate medium; they can refer to the internal communication between two components or the interaction between two components. Those skilled in the art can understand the specific meaning of the above terms in this application according to the specific circumstances.
[0023] In order to make the technical means, creative features, purposes and effects of the present application easy to understand, the following embodiments will be described in detail with reference to the accompanying drawings.
[0024] Embodiments
[0025] Figure 1 is a flowchart of the tunnel risk reasoning method combining knowledge graph and large language model in the embodiments of the present application.
[0026] As Figure 1 shown, the present embodiment provides a tunnel risk reasoning method combining knowledge graph and large language model, which comprises:
[0027] Step S1, obtaining structured monitoring data and unstructured text data, using field standardization and missing value processing on the structured monitoring data to achieve uniform format structured monitoring data, and using sentence division, word segmentation and denoising processing on the unstructured text data to convert it into uniform text input format unstructured text data.
[0028] Among them, step S1 also includes semi-structured data, and the semi-structured data is preprocessed by using the preprocessing methods of structured monitoring data and unstructured text data at the same time.
[0029] In the present embodiment, the structured monitoring data is, for example, sensor data, equipment operation log, etc., the semi-structured data includes design drawings, construction records, etc., and the unstructured text data includes inspection reports, accident reports, etc.
[0030] Figure 2 is a structural diagram of the BiLSTM-CRF model in the embodiments of the present application.
[0031] As Figure 2 shown, step S2, using BiLSTM-CRF model to extract entities from structured monitoring data and unstructured text data, and extracting the relationship between entities based on entity recognition results, using entities and the relationship between entities to form basic triples, forming sub-graphs with basic triples, and integrating sub-graphs to form a knowledge graph.
[0032] Among them, step S2 comprises the following sub-steps:
[0033] Step S20, using BiLSTM-CRF model to perform sequence labeling on the text related to tunnel monitoring, capturing context information through BiLSTM model, combining CRF structure to optimize label sequence, identifying entities in the text, and outputting labeling results, and the objective function is:
[0034]
[0035] where L is a loss function, M is the number of samples, P(y i |x i ; theta) is a conditional probability given input x i . Wherein the entities in the text include but are not limited to: structural members, monitoring indicators, anomaly types, location nodes, and inducements.
[0036] In step S20, the performance of the BiLSTM-CRF model is evaluated using the four indicators of accuracy, precision, recall, and F1 value.
[0037] Figure 3 is the flowchart of the classification extraction in the embodiment of the present application.
[0038] Figure 4 is the flowchart of the non-classification extraction in the embodiment of the present application.
[0039] As shown in Figure 3 and Figure 4 , in step S21, based on the recognition results of the entities, the semantic relationship between the entities is extracted using the rule matching and dependency syntax analysis method to form basic triplets.
[0040] In step S21, for cases with a large number of relationship phrases, relationship phrase embedding and hierarchical clustering techniques are introduced for classification.
[0041] In step S22, the sub-graphs are integrated, the entity alignment and semantic unification are completed through entity similarity calculation, naming normalization, and hierarchical alignment, and the knowledge graph is constructed by introducing time labels, spatial topological relationships, and logical dependency information. The knowledge graph constructed in this embodiment can be used for semantic retrieval, graph path reasoning, and can enhance the model input.
[0042] In step S23, for texts with standardized format or clear structure, a pre-defined semantic extraction template is constructed, the text is quickly matched through regular rules and template library, and entity-relation-entity triplets are directly generated.
[0043] In step S3, the sensor data and the corresponding entities in the knowledge graph are combined to generate a natural language prompt, the sub-graphs related to the natural language prompt are extracted from the knowledge graph, the sub-graphs are converted into vector form sub-graphs using graph embedding algorithms, the entities and their relationship paths are extracted from the knowledge graph as explicit reasoning clues, and the natural language prompt, the vector form sub-graphs, and the explicit reasoning clues are input into the large language model to generate natural language output.
[0044] Wherein, step S3 includes the following sub-steps:
[0045] Step S30, combine the current sensor data with the corresponding entity in the graph to generate a natural language prompt for a specific monitoring scene. The content of the natural language prompt includes: monitoring point, monitoring index, and historical anomaly.
[0046] Step S31, extract a sub-graph related to the natural language prompt from the knowledge graph, and convert the sub-graph into a vector form of the sub-graph using a graph embedding algorithm.
[0047] In this embodiment, the graph embedding algorithm includes: graph neural network (GNN), TransE, and GAT (Graph Attention Network).
[0048] Step S32, find multiple paths from the monitoring anomaly node to the potential risk node in the knowledge graph, and extract the entity and its relationship path as an explicit reasoning clue.
[0049] Step S33, input the natural language prompt, the vector form of the sub-graph, and the explicit reasoning clue into a large language model to generate a natural language output. The output can be visually displayed or intelligently pushed to the operation and maintenance personnel.
[0050] In this embodiment, the natural language output includes: anomaly type, risk level, possible cause, affected component, and processing suggestion.
[0051] Effects of the embodiment
[0052] The tunnel risk reasoning method fusing the knowledge graph and the large language model relates to the following steps: S1, obtaining structured monitoring data and unstructured text data, field standardization and missing value processing are adopted for the structured monitoring data to realize the uniform format of the structured monitoring data, and the unstructured text data is converted into the uniform text input format of the unstructured text data by adopting sentence division, word segmentation and noise removal processing; S2, the BiLSTM-CRF model is used to extract entities from the structured monitoring data and the unstructured text data, and the relationship between the entities is extracted based on the entity recognition result, the basic triple is formed by using the entity and the relationship between the entities, the sub-graph is formed by using the basic triple, and the sub-graph is integrated to form the knowledge graph; S3, the corresponding entity in the sensor data and the knowledge graph is combined to generate a natural language prompt, the sub-graph related to the natural language prompt is extracted from the knowledge graph, the graph embedding algorithm is used to convert the sub-graph into a vector form of the sub-graph, the entity and the relationship path are extracted from the knowledge graph as explicit reasoning clues, the natural language prompt, the vector form of the sub-graph and the explicit reasoning clues are input into the large language model, and a natural language output is generated, so that the tunnel risk reasoning method fusing the knowledge graph and the large language model can integrate multi-source data information, and output high-precision and interpretable tunnel risk early warning by using the large language model.
[0053] The embodiment also processes the semi-structured data by combining the preprocessing method of the structured monitoring data and the unstructured text data.
[0054] The embodiment also uses four indexes to evaluate the performance of the BiLSTM-CRF model to ensure the accuracy of the extraction.
[0055] The embodiment also introduces the relationship phrase embedding and hierarchical clustering technology in the relationship extraction to process the situation that the relationship phrases are relatively diverse.
[0056] The embodiment also constructs a pre-defined semantic extraction template, and quickly matches the text by using the regular rules and the template library to directly generate the entity-relation-entity triple.
[0057] Those skilled in the art should understand that the present application is not limited to the above embodiments, and the above embodiments and descriptions in the specification are only to illustrate the principles of the present application, and various changes and improvements can be made without departing from the spirit and scope of the present application, and these changes and improvements all fall within the scope of the claimed present application. The scope of protection of the present application is defined by the appended claims and their equivalents.
Claims
1. A tunnel risk reasoning method fusing a knowledge graph and a large language model, characterized in that, Comprise: Step S1, obtain structured monitoring data and unstructured text data, adopt field standardization and missing value processing on the structured monitoring data to realize uniform format structured monitoring data, adopt sentence division, word segmentation and denoising processing on the unstructured text data to convert it into uniform text input format unstructured text data; Step S2, use BiLSTM-CRF model to extract entities from the structured monitoring data and the unstructured text data, and extract the relationship between the entities based on the entity recognition result, use the entities and the relationship between the entities to form a basic triple, form a sub-graph based on the basic triple, and integrate the sub-graph to form a knowledge graph; Step S3, combine sensor data with corresponding entities in the knowledge graph to generate a natural language prompt, extract a sub-graph related to the natural language prompt from the knowledge graph, convert the sub-graph into a vector form sub-graph using a graph embedding algorithm, extract entities and their relationship paths from the knowledge graph as explicit reasoning clues, and input the natural language prompt, the vector form sub-graph and the explicit reasoning clues into a large language model to generate a natural language output.
2. The tunnel risk reasoning method of fusing a knowledge graph and a large language model according to claim 1, characterized in that, In step S1, semi-structured data is also included, which uses the preprocessing methods of the structured monitoring data and the unstructured text data at the same time during preprocessing.
3. The tunnel risk reasoning method of fusing a knowledge graph and a large language model according to claim 1, Its characteristics are that Wherein, the step S2 includes the following sub-steps: Step S20, use the BiLSTM-CRF model to perform sequence labeling on the text related to tunnel monitoring, capture context information through the BiLSTM model, optimize the label sequence combining the CRF structure, identify the entities in the text, and output the labeling result, and the objective function is: where L is a loss function, N is the number of samples, P(y i |x i ; θ) is the conditional probability given input x i ; θ). Step S21, based on the entity recognition result, use rule matching and dependency syntax analysis method to extract the semantic relationship between entities to form a basic triple; Step S22, uniformly integrate the sub-graph, align the entities and unify the semantics through entity similarity calculation, naming normalization, and upper and lower position completion, while introducing time label, spatial topology relationship and logical dependency information to build the knowledge graph.
4. The tunnel risk reasoning method of fusing a knowledge graph and a large language model according to claim 3, characterized in that, In step S20, the accuracy, precision, recall and F1 value are used to evaluate the performance of the BiLSTM-CRF model.
5. The tunnel risk reasoning method of fusing a knowledge graph and a large language model according to claim 3, characterized in that, In step S21, for the case that the relationship phrase is relatively diverse, relationship phrase embedding and hierarchical clustering technology are introduced for classification.
6. The tunnel risk reasoning method of fusing a knowledge graph and a large language model according to claim 3, characterized in that, Also include: Step S23, for text with clear format and structure, construct a pre-defined semantic extraction template, quickly match the text through regular rules and template library, and directly generate entity-relation-entity triplets.
7. The tunnel risk reasoning method of fusing a knowledge graph and a large language model according to claim 1, Its characteristics are that Wherein, the step S3 includes the following sub-steps: Step S30, combine the current sensor data with the corresponding entities in the graph to generate a natural language prompt for a specific monitoring scenario, the content of the natural language prompt includes: monitoring point, monitoring index, historical anomaly; Step S31, extracting a sub-knowledge graph related to the natural language prompt from the knowledge graph, and converting the sub-knowledge graph into a vector form of the sub-knowledge graph by using a graph embedding algorithm; Step S32, finding a plurality of paths from the abnormal node to the potential risk node in the knowledge graph, and extracting entities and their relationship paths as explicit reasoning clues; Step S33, inputting the natural language prompt, the vector form of the sub-knowledge graph and the explicit reasoning clues into a large language model to generate a natural language output.
8. The tunnel risk reasoning method of fusing a knowledge graph and a large language model according to claim 7, characterized in that, The graph embedding algorithm includes a graph neural network, TransE and GAT.
9. The tunnel risk reasoning method of fusing a knowledge graph and a large language model according to claim 7, characterized in that, The natural language output includes an abnormal type, a risk level, a possible cause, an affected component and a processing suggestion.
Citation Information
Cited By
Tunnel geological anomalous body identification method, medium, equipment and product
CN121660109A
A method, medium, equipment and product for identifying geological anomalies in tunnels.
CN121660109B
Tunnel fire intelligent decision support method and device and medium
CN121745257A
A tunnel fire intelligent decision support method, device and medium
CN121745257B
