Water conveyance project operation risk affair graph construction method and system based on inspection text
By applying large language models and word vector coding models in water transport projects, risk events are extracted and classified from inspection texts, and the event association relationship is identified using association rule mining methods, the problem of difficulty in constructing a risk rational map of water transport projects in the existing technology is solved, and effective mining and map construction of risk event association relationships are realized.
Patent Information
- Application Number
- CN202411598128.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-07
- Publication Date
- 2025-02-28
Smart Images

Figure CN119537604A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of constructing a cause-and-effect graph, and in particular to a method and system for constructing a cause-and-effect graph of water delivery project operation risks based on inspection texts. Background Art
[0002] In the process of project operation management, timely warning of possible dangers and disasters and taking correct preventive measures in advance are the key to ensuring the safe operation of the project, which requires a lot of knowledge support. With the development and application of information technology in project operation management, a large amount of inspection and hidden danger investigation data has been accumulated, which contains a lot of knowledge about accident causes and risk evolution. However, most of the inspection data are currently stored in the database in the form of unstructured text, without the transformation from data to knowledge, and it is difficult for staff to explore the relationship between risk events and between risk events and other factors. Summary of the invention
[0003] In order to solve the above-mentioned problems, the present invention provides a method and system for constructing a risk graph of water transfer project operation based on inspection text, which realizes the relevant technical process from data collection, event extraction, event classification and event relationship identification to graph construction, and helps to study and analyze the basic information and evolution process of risks.
[0004] To achieve the above object, the present invention provides a method for constructing a risk map of water supply project operation based on inspection text, comprising the following steps:
[0005] Step S1: Collect inspection texts of water delivery projects and perform preprocessing;
[0006] Step S2: Use a large language model to enrich external semantic knowledge, adopt a multi-round question-answering method, integrate domain prior information, assist the model in understanding the text context, and realize the extraction of multiple risk event elements under small samples;
[0007] Step S3: Using the risk event elements and the word vector encoding model, the vectors of each word in the risk event are aggregated to form a risk event sentence vector, which reflects the key information and semantic features of the event and realizes the classification of risk event instances in the absence of a domain dictionary;
[0008] Step S4: Use association rule mining methods to analyze risk event data in different time periods, mine out frequently co-occurring risk event pairs, use different evaluation indicators to verify, ensure the effectiveness and reliability of the rules, and identify implicit associations between risk events;
[0009] Step S5: Construct a risk graph for water transfer project operation, store the mined risk event pairs in a graph database, display the development logic of the events, analyze the evolution law of risk events, and provide support for risk disposal decisions.
[0010] Preferably, step S2 also includes converting event extraction into a machine reading comprehension task, constructing different questions for different event elements, and using a large language model to answer specific questions to achieve the event extraction task.
[0011] Preferably, in step S2, the risk event is represented as the building name, failure location and failure mode; appropriate prior information is selected for different features to construct questions, and the T5 large language model is used to generate answers in a sequence-to-sequence manner.
[0012] Preferably, in step S3, a spatial vector representation of risk events is obtained through a word vector encoding model, and semantically similar risk events are classified based on cosine similarity.
[0013] Preferably, in step S3, the word2vec word vector encoding model is used, the word vector is based on the risk event of the word vector, the sentence vector is based on the risk event sentence of the word vector, and the word vector and sentence vector are concatenated to obtain a high-quality event sentence vector.
[0014] Preferably, in step S4, a sliding time window is used to obtain a risk event transaction set, and risk event pairs with strong association rules in the transaction set are mined based on an association rule mining method.
[0015] Preferably, in step S4, the Apriori association rule mining method is used to mine frequent item sets in the risk event transaction set; and risk event pairs that meet the confidence and lift evaluation indicators are obtained from the frequent item sets.
[0016] A system for constructing a risk graph of water delivery project operation based on inspection text, comprising a data acquisition module, an event extraction module, an event classification module and an event relationship recognition module;
[0017] Obtain water delivery project inspection texts through the data acquisition module;
[0018] The event extraction module uses a large language model to extract risk event features from text;
[0019] The event classification module uses a word vector encoding model to classify different event instances under the same event type;
[0020] In the event relationship identification module, association rule mining method is used to mine risk event pairs with causal relationships.
[0021] Preferably, a computer program is stored on a computer-readable storage medium, and the computer program completes any step of a method for constructing a risk map of water transfer project operation based on inspection text based on a processor.
[0022] Therefore, the present invention adopts the above-mentioned method and system for constructing a risk map of water delivery project operation based on inspection text, which has the following beneficial effects:
[0023] (1) The present invention currently lacks annotated corpus in the field of water conservancy, and it is difficult to train a supervised event extraction neural network model. In this scheme, the rich external semantic knowledge of the large language model is utilized, and the event extraction task is converted into a machine reading comprehension task. By adding domain prior information to the question-answering template, a better extraction effect can be achieved.
[0024] (2) In order to make different event instances of the same event type have the same expression, the present invention uses a word vector encoding-based method to generate event sentence vectors, and uses vector cosine similarity to merge similar risk events into the same event type, thereby reducing the problem that the traditional word vector-based sentence vector generation algorithm is susceptible to errors caused by word segmentation results.
[0025] (3) The present invention uses an association rule mining algorithm to identify the implicit relationship between single events described in short inspection texts, providing a new idea for the construction of a cause-and-effect graph, which is more conducive to discovering potential risk event associations.
[0026] The technical solution of the present invention is further described in detail below through the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] Figure 1 It is a flow chart of a method for constructing a risk map of water delivery project operation based on inspection texts according to the present invention;
[0028] Figure 2 This is a flow chart of risk event extraction based on a large language model in the present invention;
[0029] Figure 3 It is a flow chart of risk event sentence vector generation based on word vector encoding in the present invention;
[0030] Figure 4 It is a flow chart of the operation of the sliding time window model in the present invention. DETAILED DESCRIPTION
[0031] The technical solution of the present invention is further described below through the accompanying drawings and embodiments.
[0032] Unless otherwise defined, technical or scientific terms used in the present invention shall have the common meanings understood by one having ordinary skills in the field to which the present invention belongs.
[0033] The words "include" or "comprises" and the like used in the present invention mean that the elements before the word include the elements listed after the word, and do not exclude the possibility of also including other elements. The orientation or position relationship indicated by the terms "inside", "outside", "upper", "lower", etc. is based on the orientation or position relationship shown in the drawings, which is only for the convenience of describing the present invention and simplifying the description, and does not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation. Therefore, it cannot be understood as a limitation of the present invention. When the absolute position of the described object changes, the relative position relationship may also change accordingly. In the present invention, unless otherwise clearly specified and limited, the terms "attachment" and the like should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral body; it can be directly connected, or indirectly connected through an intermediate medium, and it can be the internal connection of two elements or the interaction relationship between two elements. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0034] Example
[0035] A method for constructing a risk map of water supply project operation based on inspection texts includes the following steps:
[0036] Step S1: Collect inspection texts of water delivery projects and perform preprocessing; collect original inspection text data, and perform data cleaning such as sentence segmentation and stop word removal to make the data more convenient for subsequent calculations and for subsequent graph construction;
[0037] Step S2: Use a large language model to enrich external semantic knowledge, adopt a multi-round question-answering method, integrate domain prior information, assist the model in understanding the text context, and realize the extraction of multiple risk event elements under small samples; Step S2 also includes using a sequence-to-sequence large language model to convert event extraction into a machine reading comprehension task, construct different questions for different event elements, and use a large language model to answer specific questions to achieve the event extraction task.
[0038] In step S2, risk events are represented as building names, failure locations, and failure modes; risk event element extraction is modeled as a machine reading comprehension task, different question templates are constructed for different risk event elements, and domain prior information is added to the templates to improve the extraction effect. Appropriate prior information is selected for different features to construct questions, and the T5 large language model is used to generate answers in a sequence-to-sequence manner.
[0039] Step S3: Utilize risk event elements and use a word vector encoding model to aggregate the vectors of each word in the risk event to form a risk event sentence vector, which reflects the key information and semantic features of the event and realizes the classification of risk event instances in the absence of a domain dictionary. In step S3, use the word2vec word vector encoding model, with word vectors based on the risk events in the word vectors and sentence vectors based on the risk event sentences in the word vectors. The word vectors and sentence vectors are concatenated to obtain high-quality event sentence vectors.
[0040] In step S3, the risk event instances are classified so that different event instances of the same risk event type have a unified description. First, the common risk events in the water transfer process are classified, and the first and second level categories are divided according to the project type and the building type, location and facility type contained therein, and then the specific risk events under the second level category are subdivided to obtain an accurate and comprehensive risk event category description. The risk event failure mode elements extracted in step S2 are used to form a training corpus, and the corpus is segmented and divided into words, and the word embedding method is used to pre-train to obtain word embedding and word embedding models. Then, the word embedding and word embedding models are used to encode the risk event sentence vectors to be classified, and the vectors are spliced to obtain the risk event sentence vectors of word fusion. Similarly, the risk event type description is encoded to obtain the risk event type sentence vector. The spatial vector representation of the risk event is obtained by the word vector encoding model, and the semantically similar risk events are classified based on cosine similarity. The vector cosine similarity is selected to represent the sentence semantic similarity, and the risk event sentence vector and the category sentence vector are judged by cosine similarity, and the most similar risk event category is selected as the classification result. In Chinese, words are composed of one or more characters. Characters are the smallest semantic units and each character has independent semantic value. Using word vectors to encode event sentence vectors can reduce the problem of event sentence vector deviation caused by the lack of domain dictionaries and word segmentation errors, and further improve the accuracy of event classification.
[0041] Step S4: Use the association rule mining method to analyze the risk event data in different time periods, mine out frequently co-occurring risk event pairs, use different evaluation indicators to verify, ensure the effectiveness and reliability of the rules, and identify implicit associations between risk events; In step S4, use a sliding time window to obtain the risk event transaction set, and mine risk event pairs with strong association rules in the transaction set based on the association rule mining method.
[0042] In step S4, the Apriori association rule mining method is used to mine frequent item sets in the risk event transaction set; and risk event pairs that meet the confidence and lift evaluation indicators are obtained from the frequent item sets.
[0043] To identify risk event pairs with associated relationships. The goal of association rule mining is to find frequently occurring data item sets from the risk event transaction set, and to generate all frequent item sets that meet the confidence and lift thresholds based on the frequent item sets. Use a sliding time window to construct a risk event transaction set, sort the risk events that occur in the same building in chronological order, and then build a sliding time window model with a window width of w and a moving step of s. The first recorded risk event occurrence time is the starting point of the sliding time window, and it moves backwards for s time lengths in sequence. Each risk event that enters the window constitutes a transaction until the sliding time window reaches the right boundary of the risk event sequence. Finally, merge the transaction sets of all buildings in the water transfer project. Association rule mining is divided into two steps: first, find all frequent item sets in the data set whose support is greater than the minimum support threshold; second, use these frequent item sets to generate strong association rules that meet the minimum confidence threshold and lift threshold. Strong association rules consist of two parts: the antecedent and the consequent. The antecedent represents the prerequisite for the occurrence of the rule, and the consequent represents the occurrence result caused by the antecedent. Strong association rules can be used to explain the potential association relationship in the data set.
[0044] Step S5: Construct a risk graph for water transfer project operation, store the mined risk event pairs in a graph database, display the development logic of the events, analyze the evolution law of risk events, and provide support for risk disposal decisions.
[0045] Risk events are divided into antecedent sets and consequent sets according to their types. The antecedent set is a set of events that meet the characteristics of risk factors, and the consequent set is a set of events that meet the characteristics of disaster accidents. The event pairs that satisfy A->B in the association rules (where A belongs to the antecedent set and B belongs to the consequent set) are converted into (entity, relationship, entity) triples, where the event is the entity, the relationship is the result, and the entity attributes include event type and event attributes, etc. Then, the graph database is used to store the event triple knowledge to complete the construction of the risk graph of water transfer project operation.
[0046] A system for constructing a risk graph of water delivery project operation based on inspection text, comprising a data acquisition module, an event extraction module, an event classification module and an event relationship recognition module;
[0047] Obtain water delivery project inspection texts through the data acquisition module;
[0048] The event extraction module uses a large language model to extract risk event features from text;
[0049] The event classification module uses a word vector encoding model to classify different event instances under the same event type;
[0050] In the event relationship recognition module, the association rule mining method is used to mine risk event pairs with causal relationships.
[0051] Based on a computer-readable storage medium storing a computer program, the computer program completes the steps of any one of a method for constructing an operation risk event logic graph of a water conveyance project based on inspection texts based on a processor.
[0052] Example 1
[0053] Obtain the original inspection text data from 2015 to 2018. Due to the large project span, the complexity of inspectors, and the non-standard problem descriptions, there is a lot of noise in the text. Therefore, it is necessary to clean and format the original text data to better perform the event extraction task. First, there may be multiple event descriptions in a piece of text data. So, the character matching method is used to split the long text into sentences according to punctuation marks such as full stops and semicolons. Then, with the help of the Harbin Institute of Technology stop word list, stop words such as "le" and "de" in the text are removed.
[0054] Perform machine reading comprehension on the constructed Q&A template and extract three risk event elements contained therein. Due to the large language model technology involved, it is difficult for individuals to obtain a large amount of training corpus, and model training requires huge computing resources. An open-source Chinese large language model on the Internet is used. The Chinese T5 large language model Randeng-T5-784M-QA-Chinese released by the IDEA Research Institute is used in this embodiment. The input of this model is the concatenation of the text to be extracted and the question. Q=(q1,q2,…,q n ) is the question template, P=(p1,p2,…,p m ) is the text to be extracted, and [CLS] and [SEP] are special delimiters used to distinguish the two. The formula is as follows.
[0055] input = [CLS] + Q + [SEP] + P
[0056] The output is the start and end positions of the predicted answer.
[0057] Represent the text as a spatial vector, and represent the text semantic similarity by calculating the spatial distance of the vectors, so as to complete the risk event classification task. In this embodiment, the Word2vec word vector encoding model is used to encode the risk event sentence vectors. The risk event failure mode elements extracted in step 2 are used to form a corpus. The jieba word segmentation tool is used to segment each sentence in the corpus. The processed corpus is trained with the continuous bag-of-words model CBOW of Word2vec to obtain a word vector file. Calculate the TF-IDF weights of each word in the corpus. Finally, find the word vector W i corresponding to each word in the sentence to be encoded, and perform weighted averaging with the weight of this word to obtain the risk event sentence vector representation based on word vectors. The formula is: Similarly, the sentences in the corpus are segmented, the word vector file is obtained using the CBOW model, the TF-IDF weight of each word in the corpus is calculated, and the word vector W corresponding to each word in the sentence to be encoded is found. i , and weighted averaged with the weight of the changed word to obtain the risk event sentence vector representation E based on the word vector sc , E s and E sc The final risk event sentence vector is obtained by concatenation. The cosine similarity between the risk event sentence vector and the category description sentence vector is calculated respectively, and the category description with the highest similarity is used as the final representation of the risk event failure mode. At the same time, the minimum similarity threshold is set to 0.5. Risk events with similarity less than the minimum threshold are considered to lack generality and are not classified.
[0058] Use a sliding time window to segment the time series data. In this embodiment, the time window width is set to 6 months, and the sliding step is set to 1 week, and a transaction set containing 1031 transaction data is obtained. Based on the event transaction set, this embodiment uses the Apriori association rule mining algorithm. First, the support threshold is set, and then the event transaction set is scanned to obtain a candidate 1-item set. The support of each event transaction is counted, and the minimum support is compared. The related events that do not reach the minimum support are deleted, and the remaining is the event frequent 1-item set. Based on the event frequent 1-item set, the 1-item set is connected to each other to obtain a candidate 2-item set, and the infrequent items in the candidate 2-item set are deleted to obtain a frequent 2-item set. The connection and pruning operations are continuously performed by analogy until the connection operation cannot be performed. Finally, the frequent item set is verified for confidence, that is, according to each frequent item set, all its non-empty true subsets are found, and according to these non-empty true subsets, all candidate association rules are formed in pairs, and the confidence of all candidate association rules is calculated. The association rules with less than the minimum confidence are deleted to obtain strong association rules. In addition, the lift can indicate whether there is a positive correlation between two related risk events, so in addition to the confidence, a lift evaluation index is introduced. In this embodiment, the support, confidence and lift are set to 0.03, 0.5 and 1 respectively.
[0059] In order to better utilize the mined risk event association knowledge to analyze the evolution law between risk events, this embodiment uses Neo4j graph database to complete the storage of event knowledge and the construction of event graph. Neo4j is currently a more mainstream graph database with high scalability, supports cross-platform development, has complete ACID transaction support, and can quickly execute complex graph traversal and query, so Neo4j graph database is used as a event knowledge storage tool. Specifically, the event graph in this embodiment contains five types of nodes and three types of edges. The node types are: event text, building name, failure location, failure mode and event type, and the edge types include: "event text-event element", "event text-event type" and "event type-event type". The event graph not only records the information of the event itself, but also records in detail the logical chain of the event development, thereby providing an intuitive perspective for in-depth analysis and understanding of complex events.
[0060] This embodiment provides a method flow for constructing a causal map, studies the technical links and corresponding solutions involved in the causal map construction process, and integrates each independent solution into a complete causal map construction framework.
[0061] A system for constructing a risk graph of water delivery project operation based on inspection texts, including a data acquisition module, an event extraction module, an event classification module, and an event relationship recognition module:
[0062] Data acquisition module, used to obtain water delivery project inspection text;
[0063] The event extraction module is used to extract risk event features from text using a large language model;
[0064] An event classification module, which is used to classify different event instances of the same event type using a word vector encoding model;
[0065] The event relationship identification module is used to mine risk event pairs with causal relationships using an association rule mining method. The specific operation implementation of each module is described in the above description of each step of the method of the present invention.
[0066] Embodiment 2
[0067] A computer-readable storage medium (such as ROM / RAM, magnetic disk, optical disk) is provided, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a computer, each step of the method is implemented.
[0068] Embodiment 3
[0069] An electronic device (computer, server, smart phone, etc.) is provided, comprising a memory and a processor, wherein the memory stores a computer program, the computer program is configured to be executed by the processor, and the computer program comprises instructions for executing each step in the method of the present invention.
[0070] Therefore, the present invention adopts the above-mentioned method and system for constructing a water transfer project operation risk map based on inspection text, realizing the relevant technical process from data collection, event extraction, event classification and event relationship identification to map construction, helping to study and analyze the basic information and evolution process of risks.
[0071] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that they can still modify or replace the technical solution of the present invention with equivalents, and these modifications or equivalent replacements cannot cause the modified technical solution to deviate from the spirit and scope of the technical solution of the present invention.
Claims
1. A method for constructing a risk map of water supply project operation based on inspection text, characterized by: The following steps are involved: Step S1: Collect inspection texts of water delivery projects and perform preprocessing; Step S2: Use a large language model to enrich external semantic knowledge, adopt a multi-round question-answering method, integrate domain prior information, assist the model in understanding the text context, and realize the extraction of multiple risk event elements under small samples; Step S3: Using the risk event elements and the word vector encoding model, the vectors of each word in the risk event are aggregated to form a risk event sentence vector, which reflects the key information and semantic features of the event and realizes the classification of risk event instances in the absence of a domain dictionary; Step S4: Use association rule mining methods to analyze risk event data in different time periods, mine out frequently co-occurring risk event pairs, use different evaluation indicators to verify, ensure the effectiveness and reliability of the rules, and identify implicit associations between risk events; Step S5: Construct a risk graph for water transfer project operation, store the mined risk event pairs in a graph database, display the development logic of the events, analyze the evolution law of risk events, and provide support for risk disposal decisions.
2. According to the method for constructing a risk map of water supply project operation based on inspection text as described in claim 1, it is characterized by: Step S2 also includes converting event extraction into a machine reading comprehension task, constructing different questions for different event elements, and using a large language model to answer specific questions to achieve the event extraction task.
3. According to the method for constructing a risk map of water supply project operation based on inspection text as described in claim 1, it is characterized by: In step S2, the risk event is represented as the building name, failure location and failure mode; appropriate prior information is selected for different features to construct questions, and the T5 large language model is used to generate answers in a sequence-to-sequence manner.
4. According to the method and system for constructing a risk map of water supply project operation based on inspection text as described in claim 1, it is characterized by: In step S3, a spatial vector representation of risk events is obtained through a word vector encoding model, and semantically similar risk events are classified based on cosine similarity.
5. According to the method and system for constructing a risk map of water supply project operation based on inspection text as described in claim 4, it is characterized by: In step S3, the word2vec word vector encoding model is used, the word vector is based on the risk event of the word vector, and the sentence vector is based on the risk event sentence of the word vector. The word vector and sentence vector are concatenated to obtain a high-quality event sentence vector.
6. According to the method and system for constructing a risk map of water supply project operation based on inspection text as described in claim 1, it is characterized by: In step S4, a sliding time window is used to obtain a risk event transaction set, and risk event pairs with strong association rules in the transaction set are mined based on an association rule mining method.
7. According to the method and system for constructing a risk map of water delivery project operation based on inspection texts as described in claim 6, it is characterized by: In step S4, the Apriori association rule mining method is used to mine frequent item sets in the risk event transaction set; and risk event pairs that meet the confidence and lift evaluation indicators are obtained from the frequent item sets.
8. A system for constructing a risk map of water supply project operation based on inspection texts according to any one of claims 1, characterized in that: It includes a data acquisition module, an event extraction module, an event classification module and an event relationship identification module; Obtain water delivery project inspection texts through the data acquisition module; The event extraction module uses a large language model to extract risk event features from text; The event classification module uses a word vector encoding model to classify different event instances under the same event type; In the event relationship identification module, association rule mining method is used to mine risk event pairs with causal relationships.
9. A system for constructing a risk map of water supply project operation based on inspection text according to claim 8, characterized in that: A computer program is stored on a computer-readable storage medium, and the computer program completes the steps of a method for constructing a risk map of water transfer project operation based on inspection text according to any one of claims 1 to 7 based on a processor.
Citation Information
Cited By
Highway bridge engineering construction safety monitoring method
CN120952539A
Emergency event intelligent association analysis system and method based on knowledge graph
CN121859909A
An emergency event intelligent correlation analysis system and method based on a knowledge graph
CN121859909B
City old community security risk coupling mechanism analysis method and system
CN121981542A