Underground pipeline hidden danger management file information extraction method and device based on large model

By applying the information extraction method of large models and thinking tree prompt templates in underground pipeline hidden danger management files, the problems of high cost and low efficiency of information extraction are solved, and efficient and accurate information extraction and hidden danger identification are achieved.

CN119903025AActive Publication Date: 2025-04-29BEIJING SCI & TECH PATENT OFFICE
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202411993528.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-31
Publication Date
2025-04-29
Estimated Expiration
2044-12-31

AI Technical Summary

Technical Problem

The information extraction cost in underground pipeline hidden danger management documents is high, low efficiency, and easy to introduce human errors. The existing large-scale model methods require high-quality annotation of data, and have a large calculation resource occupancy, and high computing power costs.

Method used

The information extraction method based on the big model is adopted, and the text in the underground pipeline hidden danger management file is obtained, divided into text blocks, and a thinking tree prompt template is constructed to guide the big model to analyze and extract the entity relationship triple information. Use entity relationship verification and logical verification prompt templates to verify the accuracy and logical rationality of the extracted results, and calculate the overall reliability score to determine the information extracted results.

Benefits of technology

It realizes the efficient and accurate completion of information extraction in underground pipeline hidden danger management files, obtains structured information, improves information retrieval efficiency and hidden danger identification accuracy, and reduces manual operation and time consumption.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119903025A_ABST
    Figure CN119903025A_ABST
Patent Text Reader

Abstract

The invention provides an underground pipeline hidden danger management file information extraction method and device based on a large model. The method comprises the steps that a text in an underground pipeline hidden danger management file is divided into text blocks; constructing a thinking tree prompt template; inputting the text block and the thinking tree prompt template into the large model, enabling the large model to analyze the text block based on the thinking tree prompt template, realizing entity relation triple information extraction of the text, and outputting a result; constructing an entity relationship verification prompt template and a logic verification prompt template; inputting an output result and an entity relationship verification prompt template into the large model to verify whether each triad is accurately extracted, and calculating a verification score of the triad according to a verification result; inputting the output result and a logic verification prompt template into a large model to verify whether the extraction process is logically reasonable, and calculating a verification score of the extraction process according to the verification result; the reliability of the output result is determined according to the obtained verification score, and underground pipeline hidden danger management file information extraction is efficiently and accurately achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of artificial intelligence technology, and in particular to a method and device for extracting information from underground pipeline hazard management documents based on a large model. Background Technology

[0002] Underground pipelines are a crucial component of urban infrastructure, and the identification, analysis, and management of their hazards involve a large amount of complex documents and data. These hazard management documents are typically in unstructured or semi-structured formats, covering relevant knowledge in the field of hazard management. Furthermore, other documents, such as underground pipeline planning documents, may also contain important information related to hazard management, such as current national standards and design specifications. These documents are collectively referred to as underground pipeline hazard management documents. However, the diverse data formats and scattered information make manual parsing and information extraction costly, inefficient, and prone to human error. With the rapid development of artificial intelligence and natural language processing technologies, large-scale model-based techniques have demonstrated powerful capabilities in text understanding and information extraction. Pre-trained large-scale models, through learning on massive amounts of data, possess excellent language understanding and generation capabilities, providing new ideas for the intelligent parsing of unstructured data.

[0003] Although existing technologies for large models have achieved certain results in the field of massive data processing, they still have the following limitations: On the one hand, existing large model data processing methods rely on a certain amount of high-quality labeled data, which requires a lot of manpower and time, which to some extent limits the widespread application of the method; on the other hand, they require a lot of computing resources, resulting in high computing costs and difficulty in implementation. Summary of the Invention

[0004] In view of the above problems, the present invention is proposed to provide a method and device for extracting underground pipeline hazard management document information based on a large model, which solves or at least partially solves the above technical problems.

[0005] One aspect of the present invention provides a method for extracting information from underground pipeline hazard management documents based on a large model, the method comprising:

[0006] Obtain the text from the underground pipeline hazard management document and divide the text into several text blocks;

[0007] A mind tree prompt template is constructed, which includes a task description, output format constraints, output example description, and a mind tree structure describing the task analysis process. The task description is used to guide the perspective and output format of the large model in task execution. Each child node in the mind tree structure represents a thinking task. The mind tree structure is used to guide the large model to sequentially execute the corresponding thinking tasks based on the connection relationship between each child node in the mind tree structure to achieve the extraction of entity relationship triplet information from the text.

[0008] The divided text blocks and the mind tree prompt template are input into a preset large model, so that the large model analyzes each text block based on the mind tree prompt template, extracts the entity relationship triple information of the text according to the context, and outputs the information extraction results in a formatted format.

[0009] Construct an entity relationship verification prompt template, which includes a question description for verifying a given entity pair and relationship in an entity relationship triple;

[0010] Input the output results and entity relationship verification prompt template into the large model to verify whether each entity relationship triplet in the output results is accurately extracted. Calculate the first verification score of the corresponding entity relationship triplet based on the verification result of each entity relationship triplet.

[0011] Construct a logic verification prompt template, which includes a question description for verifying whether there are any logical conflicts in the entire extraction process;

[0012] Input the output results and logical verification prompt template into the large model to verify whether the information extraction process of the output results is logically reasonable, and calculate the second verification score of the information extraction process based on the logical verification results of the information extraction process;

[0013] The overall reliability score of the output result is analyzed based on the second verification score of the information extraction process and the first verification score of each entity relation triple in the output result. When the overall reliability score meets the preset score threshold, the output result is used as the information extraction result of the underground pipeline hidden danger management document.

[0014] Optionally, the method further includes:

[0015] During the hazard information retrieval process, all actual attribute values ​​of the underground pipeline to be analyzed are obtained;

[0016] Determine whether each actual attribute value matches the information extraction result. If all actual attribute values ​​match the information extraction result, the underground pipeline to be analyzed is determined to meet the standards of the underground pipeline hidden danger management document and has no problems or hidden dangers. Otherwise, the underground pipeline to be analyzed is determined to have problems or hidden dangers.

[0017] Optionally, determining whether each actual attribute value matches the information extraction result includes:

[0018] Determine the attribute type for each actual attribute value;

[0019] For the actual attribute value of the attribute type is text attribute, compare whether the actual value is consistent with the standard information in the information extraction result. If they are consistent, it is determined that the current actual attribute value matches the information extraction result.

[0020] For the actual attribute value of the attribute type being numerical, the actual value is compared with the standard value in the information extraction result. For information extraction results with a difference range requirement, it is determined whether the actual value is greater than or less than the standard value, and whether the difference between the actual value and the standard value is less than the difference range requirement in the information extraction result. If the actual value is greater than or less than the standard value and the difference between the actual value and the standard value is less than the difference range requirement, then it is determined that the current actual attribute value matches the information extraction result.

[0021] Optionally, the mind tree construction prompt template includes:

[0022] The pre-defined information extraction task is decomposed into a chain-like decomposition using a mind tree to obtain a mind tree structure with multiple nodes.

[0023] When constructing the root node of the mind tree, the first prompt is: problem description, clearly defining the goal of the task extraction;

[0024] When constructing the first child node of the mind tree, the second hint is designed as follows: identify the key entities and entity types in the file segment by segment, ensuring that only entities explicitly mentioned in the text are recorded. When there is only one entity in a certain category, classify that entity into the "Other" category.

[0025] When constructing the second child node of the mind tree, the third hint is: Analyze the logical relationship between entities; the relationship between entities must be a clear and logically related statement.

[0026] When constructing the third child node of the mind tree, the fourth hint designed is: based on the identified entities and relationships, verify logical consistency and data integrity;

[0027] When constructing the leaf nodes of child nodes, the fifth design tip is: the final output should be a JSON formatted result that meets the requirements.

[0028] Optionally, each child node in the mind tree structure corresponds to three different task analysis branches to simulate three different underground pipeline experts. Each task analysis branch independently completes the analysis of the task of this node based on the task analysis results of the previous node, and determines the final task analysis result of this node by sharing and discussing with other analysis branches.

[0029] Optionally, the question description in the entity relationship verification prompt template for verifying a given entity pair and relationship in an entity relationship triple includes:

[0030] Entity pair e i and e j Does it conform to the preset domain and context? Relation r ij Is entity e correctly described? i and e j The actual connections between them; and / or, whether there are any omissions, redundancies, or inconsistencies in the description of entities or relationships.

[0031] Optionally, the problem description in the logic verification prompt template used to verify whether there are logical conflicts in the entire extraction process includes:

[0032] Whether each entity relation triple in the output is logically consistent, without contradictions or duplicate descriptions; and / or whether there is a reasonable contextual semantic relationship between each entity relation triple in the output.

[0033] Optionally, the step of analyzing the overall reliability score of the output result based on the second verification score of the information extraction process and the first verification score of each entity relation triple in the output result includes:

[0034] The reliability score of the corresponding entity relation triple is obtained by multiplying the first verification score of each entity relation triple by the second verification score of the information extraction process.

[0035] The overall reliability score of the output result is obtained by summing the reliability scores of each entity relation triple in the output result.

[0036] In another aspect, the present invention provides an underground pipeline hazard management document information extraction device based on a large model, comprising 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 steps of the method as described in any one of claims 1 to 8.

[0037] A third aspect of the invention also provides a computer-readable storage medium having a computer program stored thereon that, when executed by a processor, implements the steps of the method as described in any one of claims 1 to 8.

[0038] The method and equipment for extracting information from underground pipeline hazard management documents based on a large model provided in this invention, by combining the natural language processing capabilities of a pre-trained large model with a prompt project based on a mind tree, can efficiently and accurately extract information from underground pipeline hazard management documents, obtain structured information, and provide high-quality structured data support for the identification, analysis and management of underground pipeline hazards, thereby improving information retrieval efficiency and hazard identification accuracy.

[0039] The above description is merely an overview of the technical solution of the present invention. In order to better understand the technical means of the present invention and to implement it in accordance with the contents of the specification, and in order to make the above and other objects, features and advantages of the present invention more apparent and understandable, specific embodiments of the present invention are described below. Attached Figure Description

[0040] Various other advantages and benefits will become apparent to those skilled in the art upon reading the following detailed description of preferred embodiments. The accompanying drawings are for illustrative purposes only and are not intended to limit the invention. In the drawings:

[0041] Figure 1 This is a flowchart of a method for extracting underground pipeline hazard management document information based on a large model, according to an embodiment of the present invention.

[0042] Figure 2 This is a schematic diagram illustrating the implementation principle of the method for extracting underground pipeline hazard management document information based on a large model, according to an embodiment of the present invention. Detailed Implementation

[0043] Exemplary embodiments of the present disclosure will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.

[0044] It will be understood by those skilled in the art that, unless otherwise defined, all terms used herein (including technical and scientific terms) have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains. It should also be understood that terms such as those defined in general dictionaries should be understood to have the meaning consistent with their meaning in the context of the prior art, and should not be interpreted in an idealized or overly formal sense unless specifically defined.

[0045] This invention provides a method for extracting information from underground pipeline hazard management documents based on a large model. This method efficiently and accurately extracts structured information from a large number of underground pipeline hazard management documents to support the retrieval of underground pipeline hazard knowledge, thereby improving information retrieval efficiency and hazard identification accuracy. Figure 1 As shown in the figure, the method for extracting underground pipeline hazard management document information based on a large model proposed in this embodiment of the invention includes the following steps:

[0046] S1. Obtain the text from the underground pipeline hazard management document and divide the text into several text blocks.

[0047] In this embodiment, underground pipeline hazard management documents are generally presented in PDF format, including hazard management documents and other documents such as underground pipeline planning documents, such as current national standards and design content. Specifically, for the PDF format underground pipeline hazard management documents to be processed, the PyMuPDF library in Python can be used to extract text D from them. Utilizing the advanced functions provided by PyMuPDF, such as extraction, analysis, and manipulation of PDF content, ensures that the extracted text format meets the requirements and will not affect subsequent processing and evaluation. Then, the extracted text D is divided into blocks of length L, where L is smaller than the maximum context window of the large model: {chunk1, chunk2, ..., chunk...} N This approach balances the trade-off between context size and computational efficiency. Each text block is processed individually, allowing the large model to focus on each part, optimizing the accuracy and efficiency of information extraction.

[0048] S2. Construct a mind tree prompt template, which includes a task description, output format constraints, output example description, and a mind tree structure describing the task analysis process. The task description is used to guide the perspective and output format of the large model in task execution. Each child node in the mind tree structure represents a thinking task. The mind tree structure is used to guide the large model to sequentially execute the corresponding thinking tasks based on the connection relationship between each child node in the mind tree structure to achieve the extraction of entity relationship triplet information from the text.

[0049] Due to the unique linguistic characteristics of underground pipeline hazard management documents, these documents typically contain technical terminology, complex structures, and diverse formats. To accurately extract information from these documents, this invention, when constructing the mind tree prompt template, decomposes the preset information extraction task into a chain-like mind tree structure with multiple nodes. In the development of the prompt, this invention employs components such as mind trees, task descriptions, output format constraints, and output example descriptions to enhance the model's performance in extracting information from underground pipeline hazard management documents.

[0050] Task Description

[0051] Clearly define the task description to establish a specific context, thereby guiding the perspective and output style of the large model during task execution.

[0052] Entity extraction: Identify key entities and entity types in a file.

[0053] Relationship extraction: Analyzing the logical relationships between entities.

[0054] Output format constraints

[0055] By providing a detailed description of the output format, we ensure that the extracted information is presented in a consistent and structured manner.

[0056] Please output the results in the following JSON format:

[0057] Entities: Lists all entities and their categories mentioned in the document.

[0058] Relationships: Describes the relationships between entities, including Entity 1, the relationship, and Entity 2.

[0059] Output example description

[0060] Adding examples and providing specific explanations of the expected output to the prompts can further improve performance and help the model better understand the task.

[0061] Example document: "4.1.2 The overall design of water supply and reclaimed water pipeline systems shall comply with the relevant provisions of the current national standards 'Code for Design of Outdoor Water Supply' GB50013 and 'Code for Design of Urban Wastewater Reuse Engineering' GB50335."

[0062] Example output: {<entity>:{<1. Current National Standards>:[《Outdoor Water Supply Design Code》GB50013, 《Urban Wastewater Reuse Engineering Design Code》GB50335],<2. Overall Design of Piping System>:[Overall Design of Water Supply and Reclaimed Water Piping System]},

[0063] <Relationship>: [[The overall design of water supply and reclaimed water pipeline systems shall comply with the "Code for Design of Outdoor Water Supply" GB50013], [The overall design of water supply and reclaimed water pipeline systems shall comply with the "Code for Design of Urban Wastewater Reuse Engineering" GB50335]]}.

[0064] Mind Tree Rules

[0065] The task analysis follows the node sequence below. Each child node in the mind tree structure corresponds to three different task analysis branches, simulating three different underground pipeline experts. Each simulated underground pipeline expert independently completes the analysis of this node's task based on the analysis results of the previous node, sharing and discussing with the underground pipeline experts simulated by other analysis branches. If an expert is found to have made an error in their analysis during this process, that expert withdraws, thus determining the final task analysis result for this node. A detailed description of the analysis process for the three underground pipeline experts is provided for each node task:

[0066] When constructing the root node of the mind tree, the first prompt is: problem description, clearly defining the goal of the task extraction;

[0067] When constructing the first child node 1 of the mind tree, the second hint is designed as follows: Identify the key entities and entity types in the file segment by segment, ensuring that only entities explicitly mentioned in the text are recorded. When there is only one entity in a certain category, the entity can be classified into the "Other" category.

[0068] When constructing the second sub-node 2 of the mind tree, the third hint is: Analyze the logical relationship between entities. The relationship between entities must be a clear and logically related statement.

[0069] When constructing the third sub-node 3 of the mind tree, the fourth hint designed is: based on the identified entities and relationships, verify logical consistency and data integrity;

[0070] When constructing the leaf nodes of child nodes, the fifth design tip is: the final output should be a JSON formatted result that meets the requirements.

[0071] Complete the analysis of all nodes and output the final results.

[0072] In addition, the mind tree prompt template also includes separator descriptions: use separators such as "***" and "===" to clearly separate and highlight the key parts of the prompt, help the model distinguish different parts of the instruction, and maintain focus and goal for each part.

[0073] S3. Input the divided text blocks and the mind tree prompt template into the preset large model, so that the large model can analyze each text block based on the mind tree prompt template, extract the entity relationship triple information of the text according to the context, and output the information extraction results in a formatted format.

[0074] In this embodiment, after obtaining the mind tree prompt template, the mind tree prompt template is combined with the text block chunk. iInput a large model, let it analyze the task step by step according to the mind tree, extract information from the text according to the context, and output it in JSON format.

[0075] S4. Construct an entity relationship verification prompt template, which includes a question description for verifying a given entity pair and relationship in an entity relationship triplet.

[0076] S5. Input the output results and entity relationship verification prompt template into the large model to verify whether each entity relationship triplet in the output results is accurately extracted. Calculate the first verification score of the corresponding entity relationship triplet based on the verification result of each entity relationship triplet.

[0077] In this embodiment, after obtaining the formatted output results, the entity relationship verification (Q1) process is also included. Specifically, an entity relationship verification prompt template is constructed, and the output results and entity relationship verification prompt are input into the large model to verify whether each entity relationship triplet extracted is accurate. The large model outputs Yes / No to evaluate whether the entity and its relationship have been accurately extracted.

[0078] S6. Construct a logic verification prompt template, which includes a problem description for verifying whether there is a logical conflict in the entire extraction process.

[0079] S7. Input the output results and logic verification prompt template into the large model to verify whether the information extraction process of the output results is logically reasonable. Calculate the second verification score of the information extraction process based on the logic verification results of the information extraction process.

[0080] In this embodiment, a logic verification (Q2) process is also included. Specifically, a logic verification prompt template is constructed, and the output result and the logic verification prompt are input into the large model to verify whether the extraction process is accurate. The large model outputs Yes / No to evaluate whether there is a logical conflict in the entire extraction process. All extracted triples are integrated and verified to ensure that the extraction results are consistent.

[0081] S8. Analyze the overall reliability score of the output result based on the second verification score of the information extraction process and the first verification score of each entity relation triple in the output result. When the overall reliability score meets the preset score threshold, the output result is used as the information extraction result of the underground pipeline hidden danger management document.

[0082] In this embodiment of the invention, in order to ensure the absolute accuracy of the information extraction results, the overall reliability score can be selected as the total score corresponding to when all entity relationship verification and logical verification pass.

[0083] The method and equipment for extracting information from underground pipeline hazard management documents based on a large model provided in this invention, by combining the natural language processing capabilities of a pre-trained large model with a prompt project based on a mind tree, can efficiently and accurately extract information from underground pipeline hazard management documents, obtain structured information, and provide high-quality structured data support for the identification, analysis and management of underground pipeline hazards, thereby improving information retrieval efficiency and hazard identification accuracy.

[0084] In this embodiment of the invention, the question description in the entity relationship verification prompt template for verifying a given entity pair and relationship in an entity relationship triple includes:

[0085] Entity pair e i and e j Does it conform to the preset domain and context?

[0086] Relation r ij Is entity e correctly described? i and e j The actual connection between them; and / or,

[0087] Are there any missing, redundant, or inconsistent entity or relationship descriptions?

[0088] Verify whether all statements are satisfied, and answer Yes / No.

[0089] Entity pair (e) i ,e j ) and r ij The verification score is represented as V1_score(r,Q1), as shown in equation (1).

[0090]

[0091] Where ANS_1 represents the large model's response to Q1.

[0092] In this embodiment of the invention, the problem description in the logic verification prompt template used to verify whether there is a logical conflict in the entire extraction process includes:

[0093] Check whether each entity relation triple in the output is logically consistent and free from contradictions or duplicate descriptions;

[0094] And / or, whether there is a reasonable contextual semantic association between each entity relation triple in the output result, i.e., contextual consistency.

[0095] Based on the extracted triplet sequence, verify whether the entire extraction process is logically sound, and answer Yes / No.

[0096] The verification score for the consistency of the entire process is represented as V2_score(Q2), as shown in Equation (2).

[0097]

[0098] Where ANS_2 represents the large model's response to Q2.

[0099] Furthermore, the overall reliability score of the output result is analyzed based on the second verification score of the information extraction process and the first verification score of each entity relation triplet in the output result. Specifically, this includes: obtaining the reliability score of the corresponding entity relation triplet by multiplying the first verification score of each entity relation triplet with the second verification score of the information extraction process; and obtaining the sum of the reliability scores of each entity relation triplet in the output result to obtain the overall reliability score of the output result.

[0100] In this embodiment, the result of extracting an entity relation triple (e) i ,r ij ,e j Reliability score r ij The reliability score is expressed as the product of V1_score and V2_score for the entire process, as shown in Equation (3). Finally, the overall reliability score is obtained by summing the reliability scores of all extraction results, as shown in Equation (4).

[0101] Reliability_score(rk)=V1_score(rk,Q1)×V2_score(Q2) (3)

[0102]

[0103] Where n represents the number of triplets, which are ordered sequentially starting from 1, and k represents the sequence number of the triplets.

[0104] In this embodiment of the invention, the method further includes a hazard information retrieval step. Specifically, during the hazard information retrieval process, all actual attribute values ​​of the underground pipeline to be analyzed are obtained; it is determined whether each actual attribute value matches the information extraction result. If all actual attribute values ​​match the information extraction result, it is determined that the underground pipeline to be analyzed meets the standards of the underground pipeline hazard management document and has no problems or hazards; otherwise, it is determined that the underground pipeline to be analyzed has problems or hazards.

[0105] Further, determining whether each actual attribute value matches the information extraction result specifically includes: determining the attribute type of each actual attribute value; for actual attribute values ​​of text type, comparing the actual value with the standard information in the information extraction result; if they match, determining that the current actual attribute value matches the information extraction result; for actual attribute values ​​of numerical type, comparing the actual value with the standard value in the information extraction result; for information extraction results with a difference range requirement, determining whether the actual value is greater than or less than the standard value, and whether the difference between the actual value and the standard value is less than the difference range requirement in the information extraction result; if the actual value is greater than or less than the standard value and the difference between the actual value and the standard value is less than the difference range requirement, then determining that the current actual attribute value matches the information extraction result. For information extraction results without a difference range requirement but with a requirement to be greater than or less than a numerical value, it is sufficient to directly determine whether the comparison between the actual value and the standard value in the information extraction result meets the numerical requirement corresponding to the information extraction result; if it does, then determining that the current actual attribute value matches the information extraction result.

[0106] In this embodiment, during the hazard information retrieval process, the actual situation of underground pipelines and the information extracted by the system can be combined to conduct targeted analysis on potential problems of underground pipelines, so as to help locate high-risk areas, shorten the hazard investigation time, and improve work efficiency.

[0107] Specifically, potential problems can be identified by determining whether the actual attribute values ​​of underground pipelines match the extracted information. This can be described using Boolean statements.

[0108] Logical validity = Condition 1 ∧ Condition 2 ∧ ... ∧ Condition N (5)

[0109] The judgment of each condition depends on the specific attribute type and uses different Boolean operation methods:

[0110] Text attribute: Determine whether the requirements are met by comparing the actual value with the standard information. If the actual value matches the standard information, it is determined that the requirements are met.

[0111] Numerical attributes: By comparing the actual value with the standard value, it can be determined whether the following conditions are met: whether the actual value is greater than or less than the set standard value; whether the difference between the actual value and the standard value is less than the extracted difference range requirement.

[0112] In a specific example:

[0113] 1. Standards with required difference ranges:

[0114] For some standards, there may be a permissible range of difference. For example, if a standard requires that the difference between the actual and design values ​​of the channel top elevation must be within ±0.5 meters, then:

[0115] If the difference between the actual value and the design value is between -0.5 meters and +0.5 meters, it can be said that the actual elevation of the waterway matches the design requirements.

[0116] If the actual value is more than 0.5 meters higher or lower than the design value, then the waterway does not meet the requirement of this difference range and cannot be considered a match.

[0117] If the difference is zero within this range, it is considered a match.

[0118] 2. For those without a difference range requirement but needing to be greater than or less than a certain standard, such as requiring the actual value of the top elevation of Class I to Class V waterways to be greater than 2.0m, when the actual value meets this requirement, it indicates a match.

[0119] If the actual value is equal to the standard value of 2.0m instead of being greater than 2.0m, then a mismatch is determined.

[0120] Figure 2 The diagram illustrates the implementation principle of the method for extracting information from underground pipeline hazard management documents based on a large model, as presented in this invention. Figure 2 This paper illustrates the specific implementation process of the present invention, including text segmentation, prompt engineering, large-model information extraction, verification mechanism, and hazard retrieval. The method for extracting information from underground pipeline hazard management documents based on a large model has the following advantages: By combining the natural language processing capabilities of a pre-trained large model, the system can efficiently and automatically process unstructured data, accurately extract information from complex underground pipeline hazard management documents, and output it in a structured format, greatly reducing manual operation and time consumption; the mind tree-based Prompt engineering design ensures that the model can handle the professional terminology and complex structure of underground pipeline hazard management documents, achieving highly customized processing; the present invention also ensures the accuracy and reliability of information extraction through a multi-level verification mechanism, ultimately improving overall performance. Furthermore, this method relies only on the document content without using external prior knowledge, maintaining the objectivity and accuracy of the extraction results. The text block processing method further optimizes context utilization and improves the extraction effect. It can support the retrieval of underground pipeline hazard knowledge, significantly improving information retrieval efficiency and hazard identification accuracy.

[0121] The following section uses the "Urban Engineering Pipeline Comprehensive Planning Specification" as an example to extract information and illustrate the document information extraction method for underground pipeline hidden danger management based on a large model of the present invention. It describes in detail the specific implementation process of text preprocessing, prompt project, large model information extraction, verification mechanism, hidden danger retrieval, etc.

[0122] The following is a partial text of the "Code for Comprehensive Planning of Urban Engineering Pipelines":

[0123] "4.1.8 Engineering pipelines laid on the riverbed shall be selected in stable river sections, and the pipeline elevation shall be determined according to the principle of not hindering river regulation and pipeline safety, and shall comply with the following provisions:

[0124] 1. When laid under Class I to Class V waterways, its top elevation should be 2.0m below the bottom elevation of the planned waterway in the future;

[0125] 2. When laid under Class VI and Class VII waterways, its top elevation should be 1.0m below the bottom elevation of the planned waterway in the future;

[0126] 3. When laid under other river channels, its top elevation should be 0.5m below the design elevation of the riverbed.

[0127] I. Text Preprocessing

[0128] Step a1: Text Extraction

[0129] For the PDF file to be processed, use Python's PyMuPDF library to extract the text D.

[0130] Step a2: Text segmentation

[0131] Choose a suitable text block length L = 300, and divide the extracted text D into blocks of size L:

[0132] chunk1 = "3.0.1 Urban engineering pipeline comprehensive planning...and other methods of underground laying".

[0133] II. Prompt Project

[0134] The prompt template is constructed using a mind tree-based approach. Below is a sample prompt:

[0135] "The task is to extract all relevant entities and their explicit relationships from the document and output the results in a structured manner."

[0136] Entity extraction: Identify key entities and entity types in a file.

[0137] Relationship extraction: Analyzing the logical relationships between entities.

[0138] Submit the final response in JSON format. The key should be either the "Entity" category or "Relationship," and the value should be an array of entities or relationships within that category. Use === to separate the description of the output example:

[0139] ===

[0140] Example document: "4.1.2 The overall design of water supply and reclaimed water pipeline systems shall comply with the relevant provisions of the current national standards 'Code for Design of Outdoor Water Supply' GB50013 and 'Code for Design of Urban Wastewater Reuse Engineering' GB50335."

[0141] Example output: {<entity>:{<1. Current National Standards>:[《Outdoor Water Supply Design Code》GB50013, 《Urban Wastewater Reuse Engineering Design Code》GB50335],<2. Overall Design of Piping System>:[Overall Design of Water Supply and Reclaimed Water Piping System]},

[0142] <Relationship>: [[The overall design of water supply and reclaimed water pipeline systems shall comply with the "Code for Design of Outdoor Water Supply" GB50013], [The overall design of water supply and reclaimed water pipeline systems shall comply with the "Code for Design of Urban Wastewater Reuse Engineering" GB50335]]}

[0143] ===

[0144] The analysis will proceed according to the following node sequence. For each node task, assume there are three different underground pipeline experts. Each expert independently completes the analysis of their own node task based on the results of the previous node, and then shares and discusses their findings with the other experts. If any expert is found to have made an error in their analysis during this process, that expert withdraws. A detailed description of the analysis process for each node task by the three experts will be provided. The description of this section will be divided into sections using ***.

[0145] ***

[0146] • Root node: Problem description, clearly defining the goal of the extraction task.

[0147] • Sub-node 1: Identify key entities and entity types in the file segment by segment, ensuring that only entities explicitly mentioned in the text are recorded. When there is only one entity in a certain category, that entity can be classified into the "Other" category.

[0148] • Child node 2: Analyze the logical relationships between entities. The relationship between entities must be a clear and logically related statement.

[0149] • Sub-node 3: Verify logical consistency and data integrity based on the identified entities and relationships.

[0150] Leaf nodes: The final output is a JSON formatted result that meets the requirements.

[0151] Complete the analysis of all nodes and output the final results.

[0152] ***

[0153] III. Large Model Information Extraction

[0154] Step c1: Combine Prompt with text chunk i Input a large model, let it complete a detailed description of the analysis process in the form of a mind tree, and finally generate relation triples based on the context and output them in JSON format.

[0155] The following is an example of the large model's response results:

[0156] *Root Node Analysis: After receiving the task, the three underground pipeline experts first clarified the objective of the extraction task, which was to extract all relevant entities and their explicit relationships from the given text and output the results in a structured JSON format. The experts agreed that this required them to identify key entities and entity types in the file, analyze the logical relationships between entities, and ensure the logical consistency and data integrity of the output.

[0157] *Sub-node 1 Analysis: Experts A, B, and C begin to identify key entities and entity types in the document segment by segment. They notice that the text mentions different waterway classes and channels, as well as the elevation requirements for engineering pipelines laid in relation to these waterways and channels.

[0158] The entities identified by expert A include: "Class I to Class V waterways", "Class VI and VII waterways", "other waterways", "engineering pipelines", and "bottom elevation of planned waterways in the long term".

[0159] • The entity identified by expert B is similar to that of expert A, but the "engineering pipeline" is further subdivided into "engineering pipelines laid on the riverbed".

[0160] • Expert C identified the same entities as experts A and B, but further subdivided “engineering pipelines” into “engineering pipelines laid on the riverbed” and “river channels” into “Class I to Class V rivers”, “Class VI and VII rivers” and “other rivers”.

[0161] After discussion, the experts agreed that expert C's subdivision was more accurate, and therefore adopted expert C's entity classification.

[0162] *Analysis of Child Node 2: Next, the experts analyzed the logical relationships between entities. They noted that the relationships between entities were based on different waterway grades and river channels, resulting in different requirements for the elevation of engineering pipelines.

[0163] Expert A believes the relationship is: "The elevation of engineering pipelines laid on the riverbed" needs to be determined according to the waterway classification.

[0164] Expert B believes the relationship includes: the elevation requirements of "engineering pipelines laid on the riverbed" and the "long-term planned waterway bottom elevation".

[0165] Expert C believes the relationship is that the elevation requirements for "engineering pipelines laid on the riverbed" are related to the "navigation channel level" and the "river channel".

[0166] After discussion, the experts agreed that expert C's analysis was more comprehensive, and therefore adopted expert C's relationship description.

[0167] *Sub-node 3 Analysis: Experts verified logical consistency and data integrity based on the identified entities and relationships. They checked whether the descriptions of entities and relationships matched the text content and whether all relevant information was covered.

[0168] Experts A and B did not find any logical contradictions during the verification process.

[0169] During the verification process, expert C discovered that although the descriptions of entities and relationships were consistent with the text content, there was a lack of mention of "stable river section," which could be an important entity.

[0170] After revisions, the experts agreed to add "stable river section" to the entity.

[0171] *Leaf node output: Ultimately, the experts arrived at the following JSON formatted result:

[0172]

[0173] IV. Verification Mechanism

[0174] Step d1: Input the output results and entity relationship verification prompt into the large model to verify the accuracy of the extraction.

[0175] The following is an example of an entity relationship validation prompt:

[0176] "Given entity pair (e i ,e j ) and relation r ij Verify whether the following statements are accurate:

[0177] ·Entity e i and e j Is it consistent with the given domain and context?

[0178] ·Relationship r ij Is entity e correctly described? i and e j What is the actual connection between them?

[0179] Are there any missing, redundant, or inconsistent entity or relationship descriptions?

[0180] Verify that all statements are satisfied, and answer Yes / No.

[0181] The final output is Yes.

[0182] Step d2: Input the output triplet sequence results and the logical verification prompt into the large model to evaluate whether there are any logical conflicts in the entire extraction process.

[0183] Here is an example of a logic verification prompt:

[0184] "Based on the following extracted triples (e i r ij e j Verify whether there are any logical conflicts in the entire extraction process:

[0185] Are each triple logically consistent (without contradictions or redundant descriptions)?

[0186] Are there reasonable semantic connections (contextual consistency) between the triples?

[0187] Verify the logical validity of the entire extraction process by answering "Yes / No".

[0188] The final output is Yes.

[0189] Step d3: The overall reliability score is obtained by summing the reliability scores of all extracted results. The score range is 0-n (where n represents the number of relations, which is 4 in this example). The final score is 4, which means that the extracted information has high reliability.

[0190] Step d4: Check for potential problems by determining whether the textual attributes are equal to the extracted standard values ​​and whether the numerical deviation conditions are less than the threshold.

[0191] The example includes the following conditional judgment for text-type attributes: the actual selected location of the engineering pipeline laid on the riverbed is a stable river section, which meets the extracted information criteria.

[0192] The example includes the following conditional judgments for numerical deviation:

[0193] The actual top elevation of Class I to Class V waterways is 2.5m > 2.0m, which meets the extracted information standards.

[0194] The actual values ​​of the top elevation of Class VI and Class VII waterways are 1.2m > 1.0m, which meets the extracted information standards.

[0195] The actual elevation of the top of other river channels is 1m > 0.5m, which meets the standards of the extracted information.

[0196] For the sake of simplicity, the method embodiments are described as a series of actions. However, those skilled in the art should understand that the embodiments of the present invention are not limited to the described order of actions, because according to the embodiments of the present invention, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions involved are not necessarily essential to the embodiments of the present invention.

[0197] Another embodiment of the present invention provides an underground pipeline hazard management document information extraction device based on a large model, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the steps of the underground pipeline hazard management document information extraction method based on a large model as described in the above embodiment.

[0198] For the equipment implementation, since its process of extracting underground pipeline hazard management document information based on a large model is basically similar to that of the method implementation, it is described in a relatively simple way. For relevant parts, please refer to the description of the method implementation and it has the corresponding technical effects.

[0199] Another embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method for extracting underground pipeline hazard management document information based on a large model as described in the above embodiment.

[0200] The present invention provides a method and device for extracting information from underground pipeline hazard management documents based on a large model. By combining the natural language processing capabilities of a pre-trained large model with a prompt project based on a mind tree, it can efficiently and accurately extract information from underground pipeline hazard management documents to obtain structured information. This provides high-quality structured data support for the identification, analysis, and management of underground pipeline hazards, thereby improving information retrieval efficiency and hazard identification accuracy.

[0201] Furthermore, those skilled in the art will understand that although some embodiments herein include certain features included in other embodiments but not others, combinations of features from different embodiments are intended to be within the scope of the invention and form different embodiments. For example, any of the claimed embodiments can be used in any combination.

[0202] 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 extracting information from underground pipeline hidden danger management files based on a large model, characterized in that: The method comprises: Acquire text in the underground pipeline hidden danger management file, and divide the text into a plurality of text blocks; Constructing a mind tree prompt template, the mind tree prompt template includes a task description, an output format constraint, an output example description, and a mind tree structure describing the task analysis process, the task description is used to guide the perspective and output format of the large model in task execution, each sub-node in the mind tree structure represents a thinking task, and the mind tree structure is used to guide the large model to sequentially execute the corresponding thinking tasks based on the connection relationship between each sub-node in the mind tree structure to realize entity relationship triple information extraction of the text; Input each divided text block and the mind tree prompt template into a preset big model, so that the big model analyzes each text block based on the mind tree prompt template, completes the entity relationship triple information extraction of the text according to the context and formats the information extraction result for output; Constructing an entity relationship verification prompt template, wherein the entity relationship verification prompt template includes a problem description for verifying a given entity pair and a relationship in an entity relationship triple; Input the output result and the entity relationship verification prompt template into the large model to verify whether each entity relationship triple in the output result is accurately extracted, and calculate the first verification score of the corresponding entity relationship triple according to the verification result of each entity relationship triple; Constructing a logic verification prompt template, wherein the logic verification prompt template includes a problem description for verifying whether there is a logic conflict in the entire extraction process; Input the output result and the logic verification prompt template into the large model to verify whether the information extraction process of the output result is logically reasonable, and calculate the second verification score of the information extraction process according to the logic verification result of the information extraction process; The overall reliability score of the output result is analyzed based on the second verification score of the information extraction process and the first verification score of each entity relationship triplet in the output result. When the overall reliability score meets the preset score threshold, the output result is used as the information extraction result of the underground pipeline hidden danger management file.

2. The method according to claim 1, characterized in that The method further comprises: In the process of hidden danger information retrieval, all actual attribute values ​​of the underground pipeline to be analyzed are obtained; Determine whether each actual attribute value matches the information extraction result. If all actual attribute values ​​match the information extraction result, it is determined that the underground pipeline to be analyzed meets the standards of the underground pipeline hidden danger management file and has no hidden dangers. Otherwise, it is determined that the underground pipeline to be analyzed has hidden dangers.

3. The method according to claim 2, characterized in that The determining whether each actual attribute value matches the information extraction result comprises: Determine the attribute type of each actual attribute value; For the actual attribute value of the attribute type being a text attribute, comparing the actual value with the standard information in the information extraction result to see if they are consistent, and if they are consistent, determining that the current actual attribute value matches the information extraction result; For the actual attribute value whose attribute type is a numerical attribute, the actual value is compared with the standard value in the information extraction result. For the information extraction result with a difference range requirement, it is determined whether the actual value is greater than or less than the standard value, and whether the difference between the actual value and the standard value is less than the difference range requirement in the information extraction result. If the actual value is greater than or less than the standard value and the difference between the actual value and the standard value is less than the difference range requirement, it is determined that the current actual attribute value matches the information extraction result.

4. The method according to claim 1, characterized in that: The template for constructing a mind tree prompt includes: Decompose the preset information extraction task in a thinking tree chain manner to obtain a thinking tree structure with multiple nodes; When constructing the root node of the mind tree, the first prompt of the design is: problem description, clarifying the goal of the extraction task; When constructing the first child node of the mind tree, the second prompt is designed as follows: identify the key entities and entity types in the document paragraph by paragraph, ensure that only entities explicitly mentioned in the text are recorded, and when there is only one entity in a category, classify the entity into the "other" category; When constructing the second child node of the thinking tree, the third prompt designed is: analyze the logical relationship between entities. The relationship between entities must be a clear expression with logical relationship; When constructing the third child node of the mind tree, the fourth prompt designed is: verify the logical consistency and data integrity based on the identified entities and relationships; When constructing the leaf node of the child node, the fifth hint of the design is: finally output the JSON formatted result that meets the requirements.

5. The method according to claim 1, characterized in that Each sub-node in the thinking tree structure corresponds to three different task analysis branches to simulate three different underground pipeline experts. Each task analysis branch independently completes the analysis of the task of this node according to the task analysis result of the previous node, and determines the final task analysis result of this node by sharing and discussing with other analysis branches.

6. The method according to claim 1, characterized in that The problem description for verifying a given entity pair and relationship in the entity relationship triple in the entity relationship verification prompt template includes: Entity pair i and e j Is it consistent with the preset domain and context? ij Is the entity e described correctly? i and e j and / or, whether there are missing, redundant, or inconsistent descriptions of entities or relationships.

7. The method according to claim 1, characterized in that The problem description used in the logic verification prompt template to verify whether there is a logic conflict in the entire extraction process includes: Whether each entity relationship triple in the output result is logically self-consistent, without contradiction or repeated description; and / or whether there is a reasonable contextual semantic association between each entity relationship triple in the output result.

8. The method according to claim 1, characterized in that The overall reliability score of the output result is analyzed according to the second verification score of the information extraction process and the first verification score of each entity relationship triple in the output result, including: Obtaining the product of the first verification score of each entity relationship triple and the second verification score of the information extraction process to obtain the reliability score of the corresponding entity relationship triple; The total reliability score of the output result is obtained by summing up the reliability scores of each entity relationship triplet in the output result.

9. A device for extracting information from underground pipeline hidden danger management files based on a large model, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 8 are implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 8 are implemented.

Citation Information

Patent Citations

  • Government affair service field multi-strategy fusion dialogue method based on knowledge graph

    CN116628172A

  • Urban ruins knowledge graph construction method fusing event extraction technology, cultural relic data management system and readable storage medium

    CN119003794A

  • Multi-agent-based grid treatment knowledge graph construction method

    CN119150978A