Event causal relationship extraction method and device based on context time relationship

By integrating the time feature matrix and BIO annotation rules in the BERT-BiLSTM-CRF model, the problem of causal relationship extraction in urban underground space disasters is solved, the accuracy of disaster identification and the quality of the knowledge graph are improved, and a more flexible and targeted disaster management is achieved Prevention strategies.

CN118733783AActive Publication Date: 2024-10-01BEIJING UNIV OF CIVIL ENG & ARCHITECTURE

Patent Information

Application Number
CN202410622384.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-20
Publication Date
2024-10-01
Estimated Expiration
2044-05-20

AI Technical Summary

Technical Problem

Existing technologies are difficult to effectively identify and extract the causal relationships in urban underground space disasters, resulting in insufficient flexibility and pertinence of disaster emergency plans and affecting the effectiveness of disaster prevention and control.

Method used

A method based on the BERT-BiLSTM-CRF model was used to extract entities and annotate causal relationships from Chinese text data on urban underground space disasters. By splicing the encoding vectors of temporal entities with word vectors, the model's ability to perceive temporal context was enhanced, and the model was utilized Semi-supervised learning and BIO annotation rules are used to annotate relationships to improve the accuracy of causal relationship extraction.

Benefits of technology

It has improved the accuracy and reliability of causal relationship extraction of urban underground space disaster events, and improved the accuracy of disaster identification. The average precision rate, recall rate and F1 value reached 89.46%, 88.32% and 88.89% respectively, significantly improving the disaster knowledge map. Build quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118733783A_ABST
    Figure CN118733783A_ABST
Patent Text Reader

Abstract

The invention discloses an event causal relationship extraction method and device based on a context-time relationship, and the method comprises the steps: carrying out the causal relationship labeling of urban underground space disaster Chinese text data, inputting the causal relationship labeled disaster Chinese text data into a BERT-BiLSTM-CRF model, and completing the extraction of the causal relationship of an urban underground space disaster event; and when a BERT layer in the BERT-BiLSTM-CRF model outputs a word vector, carrying out splicing operation on a coding vector of a time entity and the word vector output by the BERT layer to obtain a word vector containing a time relationship, and then inputting the word vector containing the time relationship into a BiLSTM layer for processing. According to the BERT-BiLSTM-CRF model causal relationship extraction method fused with the time feature matrix, the precision of urban underground space disaster event causal relationship identification is improved, and the accuracy and reliability of causal relationship extraction are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to the field of computer technology, and in particular to a method and device for extracting event causal relationships based on contextual time relationships. Background Art

[0002] As modern cities continue to explore underground space, its importance in urban economies and transportation is becoming increasingly prominent. Disasters in urban underground spaces are a major constraint on their development and utilization. Therefore, the prevention and control of underground disasters is crucial. Scientific, efficient, economical, and timely disaster prevention and control are strategic requirements for national disaster reduction and sustainable urban development.

[0003] A knowledge graph is a graphical data structure used to represent the relationships and attributes between entities (such as people, places, concepts, etc.). It abstracts complex relationships in the real world into a graph, enabling machines to understand and process these relationships, thereby achieving semantic knowledge representation and reasoning.

[0004] The key technology in knowledge graphs is knowledge extraction. Knowledge extraction involves identifying, formatting, and filtering knowledge points within text data, and storing these knowledge points in a specific format within a knowledge database. This involves two key steps: entity extraction and relationship extraction, aiming to improve the usability and reusability of information. Mainstream methods for entity extraction include rule-based and dictionary-based methods, supervised learning-based methods, and deep learning-based methods. Relationship extraction, on the other hand, involves identifying semantic relationships within text through contextual analysis. Causal relationship extraction is a more challenging task within relationship extraction.

[0005] Because disaster characteristics, causes, and specific forms vary across regions, these uncertainties often make pre-established emergency response plans ineffective in responding to disasters and fully protecting people's lives and property. Therefore, more flexible and targeted disaster prevention and control strategies are needed. Therefore, based on informatization and using knowledge graphs, it is crucial to compile knowledge about typical urban underground space disasters into a database, provide a channel for people to access this knowledge, and establish a platform for displaying and searching urban underground space disaster knowledge based on knowledge graphs. Summary of the Invention

[0006] An object of embodiments of the present invention is to solve at least the above problems and / or disadvantages and to provide at least the advantages to be described hereinafter.

[0007] The embodiments of the present invention provide a method, device, electronic device, and storage medium for extracting event causal relationships based on contextual temporal relationships. To this end, the present invention provides the following technical solutions:

[0008] In a first aspect, a method for extracting event causal relationships based on contextual temporal relationships is provided, comprising:

[0009] Entity extraction is performed on Chinese text data of urban underground space disasters to obtain time entities;

[0010] Performing causal relationship annotation on the Chinese text data of the urban underground space disaster;

[0011] The causal relationship-annotated Chinese text data of disasters was input into the BERT-BiLSTM-CRF model to extract the causal relationship of urban underground space disaster events.

[0012] Among them, when the BERT layer in the BERT-BiLSTM-CRF model outputs a word vector, the encoding vector of the time entity is concatenated with the word vector output by the BERT layer to obtain a word vector containing a time relationship, and then the word vector containing a time relationship is input into the BiLSTM layer for processing.

[0013] Preferably, the event causal relationship extraction method based on contextual time relationship further includes:

[0014] Before performing entity extraction on the Chinese text data of urban underground space disasters, the Chinese text data of urban underground space disasters is screened and pre-processed for noise reduction, and the Chinese text data of disasters for entity extraction is retained. Then, word segmentation and labeling operations are performed. During the labeling operation, all time-related information is labeled as an entity type to obtain a time entity labeling dataset;

[0015] When performing causal relationship annotation on the Chinese text data of the urban underground space disaster, the time entity annotation dataset is superimposed to obtain disaster text data with causal relationship annotation of the time entity added;

[0016] The disaster text data with the causal relationship annotations of the time entity is input into the BERT-BiLSTM-CRF model to complete the extraction of the causal relationship of urban underground space disaster events.

[0017] Preferably, in the event causal relationship extraction method based on contextual time relationship, the method of labeling the causal relationship of the urban underground space disaster Chinese text data includes:

[0018] First, the Chinese text data on urban underground space disasters was screened and pre-processed for noise reduction. The Chinese text data for relationship extraction was retained and then word segmentation was performed. After that, a semi-supervised learning method was used to annotate causal relationships. The manually annotated text dataset was input into the LTP tool for learning, and the LTP tool then annotated the remaining dataset.

[0019] The causal relationship annotation adopts the BIO annotation rule to annotate the trigger words representing the causal relationship, and annotate the causal entity guided by each trigger word as "BX", "IX" or "O", where "BC" indicates that the position of the character is the starting part of the cause fragment, "IC" indicates that the position of the character is the non-starting position of the cause fragment, "BR" indicates that the position of the character is the starting part of the result fragment, "IR" indicates that the position of the character is the non-starting position of the result fragment, and "O" indicates that the element does not belong to any of the above types.

[0020] Preferably, in the event causal relationship extraction method based on contextual time relationship, the word vector containing the time relationship enters the BiLSTM layer again, and the BiLSTM layer uses the time relationship to perform forward and reverse information processing on it, and then uses the CRF component to model the label of the text sequence output by the BiLSTM component.

[0021] Preferably, in the event causal relationship extraction method based on contextual time relationship, when the disaster Chinese text data for entity extraction is annotated, the BIO part-of-speech tagging method is adopted, wherein "B" represents the starting node of the entity, and "I" represents all sequence labels after the starting node. The LTP tool is used for part-of-speech tagging, and the entity type is abstracted into five categories, namely "LOC", "PER", all time-related information, "ORG" and "DIS"; (1) LOC: including underground space locations such as underground passages, subways, underground shopping malls, underground parking lots and other location information; (2) PER: including information such as names and casualties; (3) T: all time-related information; (4) ORG: including rescue organizations and other social organizations; (5) DIS: including information such as the type of underground space disasters and the losses caused by disasters.

[0022] The disaster Chinese text data processed as above is input into the ALBERT-BiLSTM-CRF model to complete entity extraction, and the time entity is also obtained at this time.

[0023] Preferably, in the event causal relationship extraction method based on contextual time relationship, the urban underground space disaster Chinese text data selects the urban underground space flood disaster and pipeline accident disaster event text data.

[0024] In a second aspect, a device for extracting event causal relationships based on contextual temporal relationships is provided, comprising:

[0025] Relationship extraction preprocessing module, which is used to annotate causal relationships in Chinese text data on urban underground space disasters;

[0026] The BERT-BiLSTM-CRF model is used to extract event causal relationships from input Chinese text data on disasters that has been annotated with causal relationships. When the BERT layer in the BERT-BiLSTM-CRF model outputs a word vector, the encoding vector of the time entity of the Chinese text data on urban underground space disasters is concatenated with the word vector output by the BERT layer to obtain a word vector containing the time relationship, which is then input into the BiLSTM layer.

[0027] Preferably, the event causal relationship extraction device based on contextual time relationship further includes:

[0028] The entity extraction preprocessing module is used to label the Chinese text data of urban underground space disasters according to entity type classification, where one entity type is all time-related information, and obtain a time entity labeling dataset;

[0029] When the relationship extraction preprocessing module performs causal relationship annotation on the urban underground space disaster Chinese text data, the time entity annotation data set is superimposed to obtain disaster text data with causal relationship annotation of the time entity added;

[0030] The BERT-BiLSTM-CRF model is used to extract event causal relationships from the input disaster text data with causal relationship annotations of time entities.

[0031] Optionally, in the event causal relationship extraction device based on contextual time relationship, the method for the relationship extraction preprocessing module to perform causal relationship annotation on the urban underground space disaster Chinese text data includes:

[0032] First, the Chinese text data on urban underground space disasters was screened and pre-processed for noise reduction. The Chinese text data for relationship extraction was retained and then word segmentation was performed. After that, a semi-supervised learning method was used to annotate causal relationships. The manually annotated text dataset was input into the LTP tool for learning, and the LTP tool then annotated the remaining dataset.

[0033] The causal relationship annotation adopts the BIO annotation rule to annotate the trigger words representing the causal relationship, and annotate the causal entity guided by each trigger word as "BX", "IX" or "O", where "BC" indicates that the position of the character is the starting part of the cause fragment, "IC" indicates that the position of the character is the non-starting position of the cause fragment, "BR" indicates that the position of the character is the starting part of the result fragment, "IR" indicates that the position of the character is the non-starting position of the result fragment, and "O" indicates that the element does not belong to any of the above types.

[0034] Optionally, in the event causal relationship extraction device based on contextual time relationship, in the BERT-BiLSTM-CRF model, the word vector containing the time relationship enters the BiLSTM layer again, and the BiLSTM layer uses the time relationship to perform forward and reverse information processing on it, and then uses the CRF component to model the label of the text sequence output by the BiLSTM component.

[0035] Optionally, in the event causal relationship extraction device based on contextual time relationship, when the relationship extraction preprocessing module performs the tagging operation on the disaster Chinese text data used for entity extraction, the BIO part-of-speech tagging method is adopted, wherein "B" represents the starting node of the entity, and "I" represents all sequence labels after the starting node. The LTP tool is used for part-of-speech tagging, and the entity type is abstracted into five categories, namely "LOC", "PER", all time-related information, "ORG" and "DIS"; (1) LOC: including underground space locations such as underground passages, subways, underground shopping malls, underground parking lots and other location information; (2) PER: including information such as names and casualties; (3) T: all time-related information; (4) ORG: including rescue organizations and other social organizations; (5) DIS: including information such as the type of underground space disasters and the losses caused by disasters.

[0036] Optionally, the event causal relationship extraction device based on contextual time relationship further includes:

[0037] The ALBERT-BiLSTM-CRF model is used to extract entities from the disaster Chinese text data processed by the input relation extraction preprocessing module.

[0038] Optionally, the Chinese text data on urban underground space disasters are selected from text data on flood disasters and pipeline disaster events in urban underground spaces.

[0039] According to a third aspect, an electronic device is provided, comprising: at least one processor, and a memory communicatively connected to the at least one processor, wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor executes any one of the methods described.

[0040] In a fourth aspect, a storage medium is provided, on which a computer program is stored, and when the program is executed by a processor, any of the methods described above is implemented.

[0041] The embodiments of the present invention have at least the following beneficial effects:

[0042] In the causal relationship extraction of urban underground space disaster events, the present invention splices the encoding vector of the time entity in the text data with the word vector output by BERT, and adds the word vector of the time entity to the original word vector output by BERT. By splicing or adding the encoding vector of the time entity with the word vector of BERT, the model's perception of the temporal context can be enhanced, thereby better capturing the causal relationship between events. At the same time, adding time entities to manually annotated data can help the model learn the association between time entities and causal relationships. When annotating data, time entities and causal relationships can be annotated at the sentence level or fragment level so that the model learns the importance of time entities to causal relationship extraction and improves the accuracy and reliability of causal relationship extraction.

[0043] This paper proposes a causal relationship extraction method based on the BERT-BiLSTM-CRF model that integrates the time feature matrix. This model adds time features to the BERT-BiLSTM-CRF neural network, improving the accuracy of causal relationship identification of urban underground space disaster events. Its average precision, recall rate and F1 value are 89.46%, 88.32% and 88.89% respectively, indicating that this model has certain advantages in extracting causal relationships of urban underground space disaster events.

[0044] Other advantages, objectives, and features of the embodiments of the present invention will be reflected in part through the following description, and in part will be understood by those skilled in the art through study and practice of the embodiments of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] Figure 1 This is an example of original text data of urban underground space disasters in one embodiment of the present invention.

[0046] Figure 2 This is an example of text data after word segmentation of urban underground space disasters in one embodiment of the present invention.

[0047] Figure 3 This is an example of manual annotation in entity extraction in one of the embodiments of the present invention.

[0048] Figure 4 This is a diagram of the ALBERT-BiLSTM-CRF model architecture in one embodiment of the present invention.

[0049] Figure 5 This is a flowchart of the operation of the ALBERT-BiLSTM-CRF model in one embodiment of the present invention.

[0050] Figure 6 This is an example of part-of-speech tagging rules in relation extraction in one embodiment of the present invention.

[0051] Figure 7 This is an example of manual annotation in relationship extraction in one embodiment of the present invention.

[0052] Figure 8 This is a diagram of the BERT-BiLSTM-CRF causal relationship extraction model architecture that integrates temporal feature vectors in one embodiment of the present invention.

[0053] Figure 9 This is a flowchart of the operation of the BERT-BiLSTM-CRF causal relationship extraction model that integrates time feature vectors in one embodiment of the present invention. DETAILED DESCRIPTION

[0054] The embodiments of the present invention are further described in detail below with reference to the accompanying drawings so that those skilled in the art can implement the invention with reference to the description.

[0055] Knowledge extraction is the most fundamental step in building a knowledge graph for urban underground space hazards, and its results often determine the overall quality of the knowledge graph. In this application, based on the characteristics of underground space hazard knowledge data, we propose an ALBERT-BiLSTM-CRF named entity recognition model and an event causal relationship extraction method based on contextual temporal relationships. These two methods demonstrate excellent results in identifying and extracting knowledge in the field of urban underground space hazards.

[0056] 1.1 ALBERT-BiLSTM-CRF Named Entity Recognition Model

[0057] Named Entity Recognition (NER) is the most fundamental and critical step in building a knowledge graph. Its task is to identify entities with specific meanings in text (such as names of people, places, and organizations) and annotate them to facilitate subsequent knowledge graph construction. Named entity recognition automatically extracts and analyzes large amounts of text data to discover important information and relationships, facilitating automated information processing and mining. Named entities related to urban underground space disasters are identified from text. These named entities include the following types:

[0058] (1) Underground space: including urban underground transportation facilities, underground commercial facilities, and underground entertainment facilities;

[0059] (2) Disaster type: including fire, gas leak, flood and earthquake;

[0060] (3) Loss: including casualties and property losses;

[0061] (4) Rescue measures: including rescue team, rescue equipment and rescue time, etc.

[0062] 1.1.1 Data Preprocessing

[0063] The urban underground space disaster text data was manually screened and pre-processed with Python scripts for text noise reduction. Finally, about 1 million words of Chinese text data were retained. Figure 1 and Figure 2 As shown in the figure, the Harbin Institute of Technology Natural Language Processing Tool (LTP) is used for word segmentation, and the collected text data of urban underground space flood disasters and pipeline accident disasters are analyzed. Through manual interpretation, the entities related to urban underground space, disaster type, loss situation and rescue measures are manually labeled, and the results are created as a dictionary and added to the LTP word segmentation tool. Finally, the Chinese words contained in a large amount of Chinese text data are separated by spaces, which facilitates the input of text data into the neural network in subsequent knowledge extraction operations.

[0064] Part-of-speech tagging is the process of tagging the part of speech of each word in a text. In the task of named entity recognition, part-of-speech tagging is used as an auxiliary tool to identify the type and contextual relationship of the entity. This paper adopts the "BIO" part-of-speech tagging method, where "B" represents the start node of the entity and "I" represents all sequence labels after the start node. The LTP tool is used for part-of-speech tagging. To improve the accuracy, the entity types are abstracted into five categories, namely (1) LOC: including underground space locations such as underground passages, subways, underground shopping malls, underground parking lots, and other location information; (2) PER: including information such as names and casualties; (3) T: all time-related information; (4) ORG: including rescue organizations and other social organizations; (5) DIS: including information such as the type of underground space disasters and the losses caused by disasters. Figure 3 This is a manually labeled example. 1.1.2 ALBERT-BiLSTM-CRF model

[0065] This paper takes the Chinese text data of urban underground space disaster events as the research object and constructs the ALBERT+BiLSTM+CRF model to realize the named entity recognition research of typical urban underground space disaster knowledge. Figure 4 As shown in the figure, the model consists of ALBERT layer, BiLSTM layer and CRF layer from bottom to top. Figure 5To run the model, ALBERT is used as a feature extractor to convert the input urban underground space disaster text data into a high-dimensional vector representation to extract semantic information. This information can help the model better understand the contextual relationships in the text. Then, a bidirectional LSTM (BiLSTM) layer is used to model the contextual information of the text data to capture the dependencies existing in the context. Finally, a conditional random field (CRF) layer is used to optimize the output tag sequence of the model as a whole to make the output tag sequence of the model more accurate.

[0066] 1.1.3 Experimental environment and evaluation indicators

[0067] This experiment uses the Tensorflow 1.14 framework and the Python 3.7 environment. The GPU model is Nvidia RTX 3060 with 12GB of video memory. The pre-trained model uses the trained Chinese ALBERT model, which has 12MB of parameters, 12 layers, and a size of 40MB.

[0068] The relevant parameters of the named entity recognition task model are as follows: After preprocessing the Chinese text data, a total of 18,109 sentences were obtained. The other model parameter configurations are shown in Table 1.

[0069] Table 1 Parameter configuration

[0070]

[0071] During training, the ALBERT-BiLSTM-CRF model used precision, recall, and F1 score as the primary metrics for evaluating model performance. The specific results are detailed in Table 2. Precision measures the proportion of samples predicted as positive by the model that are actually positive; recall measures the proportion of samples correctly predicted as positive by the model among all positive samples. The F1 score is the harmonic mean of precision and recall, providing a single metric for evaluating model performance. Its expression is as follows:

[0072]

[0073]

[0074]

[0075] Table 2 Classification results

[0076]

[0077] 1.1.4 Experimental results and evaluation

[0078] Due to the large workload of manual labeling, an entity labeling dataset that is a 1:1 fusion of the manually labeled dataset and the similar People's Daily dataset is used for experiments. The final dataset size is 3.1MB, which is divided into training set, validation set, and test set in a ratio of 8:1:1 for experiments.

[0079] Table 3 shows the experimental results of different types of entities. From this table, we can see that the model has a high F1 value of 98.14% for location entities, population entities, and disaster entities. This is mainly because the entity nouns of location, population, and disaster types are relatively fixed and have clear boundaries. The effect is poor in the organization entity and time entity part. After analysis, it is found that the following three reasons may be the reason: (1) The types and names of organizations are updated frequently, and the manual annotation data set is limited; (2) When annotating time entities, time relative nouns such as "that day" and "later" are taken into account, which have no clear boundaries; (3) The number of time entity annotations is less than that of the other four types, which affects the entity recognition results to a certain extent.

[0080] Table 3 Named entity recognition results

[0081]

[0082] To verify the advantages of the ALBERT-BiLSTM-CRF model, three currently mainstream named entity recognition models were selected for comparative experiments, namely the BiLSTM-CRF model, the BERT-CRF model, and the BERT-BiLSTM-CRF model.

[0083] This paper selected the Boson dataset for comparative experiments to verify the applicability of the models. The Boson dataset contains six entity types: company_name, location, org_name, person_name, product_name, and time. These entities are similar to the types of underground space disaster entities. We maintained the same parameter settings for the four models: batch_size of 16, epoch value of 15, and lr value of 0.00001. The experimental results are shown in Table 4. It is clear that the ALBERT-BiLSTM-CRF model performs best, followed by the BERT-BiLSTM-CRF model, and the BiLSTM-CRF model performs worst.

[0084] Table 4 Experimental results of Boson dataset

[0085]

[0086] Experiments were conducted using the urban underground space dataset, with identical parameters, using four models. The results, shown in Table 5, show that all four models performed better than the Boson dataset. This is primarily due to the large number of entities in the Boson dataset, including those that are more difficult to identify, such as company names and product names. The ALBERT-BiLSTM-CRF model achieved the best performance in the urban underground space disaster recognition task, showing a significant improvement over the BERT-BiLSTM-CRF model. This is due to the ALBERT model's improved efficiency and performance through a series of technical improvements. This demonstrates that the ALBERT-BiLSTM-CRF model is suitable for the urban underground space disaster named entity recognition task.

[0087] Table 5 Experimental results of urban underground space disaster dataset

[0088]

[0089] In summary, the ALBERT-BiLSTM-CRF model proposed in this paper is a deep learning model for named entity recognition. It consists of three components: an ALBERT pre-trained language model, a bidirectional long short-term memory (BiLSTM) network, and a conditional random field (CRF). In the named entity recognition task, this model takes a text sequence as input, extracts feature representations using a pre-trained ALBERT model, performs sequence modeling using a BiLSTM network, and finally outputs a labeled sequence using a CRF model. This model demonstrates strong performance in the NER task on an open-source dataset and also achieves strong results on the urban underground space disaster dataset, achieving a precision of 95.41%, a recall of 94.08%, and an F1 score of 94.74%. These experimental results demonstrate that this model outperforms some mainstream named entity recognition methods in extracting entities in the urban underground space disaster domain, providing a valuable reference for named entity recognition tasks in the urban underground space disaster neighborhood. In this experiment, only some event and literature data were collected for urban underground space disasters, which resulted in a single entity recognition task data and thus had certain limitations. In subsequent work, we will consider expanding the types of urban underground space disaster data and expanding the applicability of the ALBERT-BiLSTM-CRF model to assist in the construction of the urban underground space disaster knowledge graph. 1.2 Event Causal Relationship Extraction Method Based on Contextual Temporal Relationship

[0090] Relation extraction is a fundamental task in building knowledge graphs. Its purpose is to identify and extract specific semantic relationships between entities from text data. In natural language processing (NLP), entities typically refer to specific people, places, organizations, and events, while relationships describe the connections between these entities. The relationship extraction component primarily focuses on news events involving urban underground space disasters. In the entity extraction experiments described above, entities such as people, locations, events, events, and disasters were extracted, effectively extracting both temporal and spatial relationships from the text data. Beyond these relationships, event causal relationships constitute a significant portion of the event content. Relation extraction can be used to obtain causal relationship triples. This paper categorizes the causes of urban underground space disasters into four categories: natural factors, human factors, design and construction, and emergencies. The consequences of urban underground space disasters are categorized into four categories: casualties, property losses, social impacts, and environmental impacts. To address the above issues, this paper proposes an event causal relationship extraction method based on contextual temporal relationships, that is, a causal relationship extraction method that uses time entities to assist disaster events.

[0091] 1.2.1 Data Preprocessing

[0092] Relationship extraction primarily focuses on news events. Due to the wide variety of underground disasters, this article focuses on typical flood and pipeline disasters. Flood disasters refer to the accumulation and submergence of urban underground spaces due to excessive rainfall, poor drainage systems, or other factors. Pipeline disasters refer to disasters caused by ruptures, leaks, and explosions of various pipelines (such as water, gas, electricity, and telecommunications) within urban underground spaces.

[0093] The collected text data on urban underground flood disasters and pipeline accidents was manually screened and pre-processed with Python scripts to reduce noise. This resulted in a total of approximately 200,000 words of Chinese text data, encompassing approximately 150 comprehensive events (including several related events). For word segmentation, this paper used the LTP tool with the entity dictionary described above. For annotation, this paper employed a semi-supervised learning approach to annotate causal relationships, using a 1:1 ratio of manual annotation to automatic annotation using the LTP tool. The manually annotated dataset was fed into the LTP tool for learning, and the LTP tool then annotated the remaining 50% of the dataset. For causal relationship annotation of Chinese text data, the "BIO" (B-begin, I-inside, O-outside) annotation rule was used. Typical trigger words indicating causal relationships were annotated, such as "because," "due to," "therefore," "cause," "so," "cause," "initiate," "result," and "after," with clear causal meanings. The causal entities associated with each trigger word were annotated with "BX," "IX," or "O." Among them, "BC" (Begin-Cause) indicates that the character is located at the beginning of the cause segment; "IC" (Inside-Cause) indicates that the character is located at a non-beginning position of the cause segment; "BR" (Begin-Result) indicates that the character is located at the beginning of the result segment; "IR" (Inside-Result) indicates that the character is located at a non-beginning position of the result segment; and "O" (Other) indicates that the element does not belong to any of the above types. Temporal entity annotation directly uses the results of the entity extraction experiment and overlays them with the causal relationship annotation dataset. Figure 6 For the marking rules, Figure 7 Specific examples are manually labeled.

[0094] 1.2.2 Causal Relationship Extraction Method Integrating Time Feature Matrix and Contextual Relationship

[0095] Disaster text data with events as the main body often uses time as the index to describe the content of the event. Therefore, in the causal relationship extraction of urban underground space disaster events, adding time entities can improve the accuracy and reliability of causal relationship extraction. The effect of adding time features to the model on causal relationship extraction is as follows:

[0096] 1) Time sequence assists in determining causal relationships. By labeling time entities, the temporal order of disaster events can be clarified, allowing for more accurate determination of causal relationships between events. For example, if an earthquake occurs first and then a ground fissure appears, it can be determined that the earthquake is the cause of the ground fissure.

[0097] 2) Time interval measurement strengthens causal relationships. By annotating time entities, we can measure the time intervals between disaster events, further strengthening causal relationships. For example, if a pipeline leak occurs immediately after an earthquake, and there is a short time interval between the two, we can conclude that the earthquake is the direct cause of the pipeline leak.

[0098] 3) Temporal dependency improves causal inference. By integrating temporal entities, we can understand the temporal dependencies between disaster events and infer causal relationships. For example, if underground flooding always occurs after heavy rainfall, we might conclude that heavy rainfall is one of the causes of the flooding.

[0099] 4) Duration and frequency reveal causal relationships. Annotating time entities can provide information about the duration and frequency of disaster events, thereby revealing causal relationships between events. For example, if heavy rainfall occurs continuously and each occurrence causes the groundwater level to rise, it may be considered that the heavy rainfall is the cause of the water level rise.

[0100] 5) Support from temporal evidence. Temporal entities can also serve as temporal evidence to support causal inferences. In disaster events, time can be an important basis for proving causality. For example, if an underground fire occurs at a certain point in time, and there are reports of a flammable gas pipeline leak before that point, the pipeline leak may be considered a cause of the fire.

[0101] This paper adopts a causal relationship extraction method that integrates a temporal feature matrix. The method proceeds as follows: First, temporal entity annotations are added to the manual annotation of the training set. The temporal entity annotation set from the entity extraction process is retained, while the causal relationship annotation set is added. Then, the encoding vectors of the temporal entities in the text data are concatenated with the word vectors output by BERT, adding the temporal entity word vectors to the original BERT word vectors. This method has the following advantages: the fusion of the temporal entity encoding vectors with the BERT word vectors enhances the influence of temporal information at the model level, while the inclusion of temporal entities in the manual annotations increases the relevance of temporal entities and causal relationships at the data level. Specifically, concatenating or adding the temporal entity encoding vectors with the BERT word vectors enhances the model's perception of temporal context, thereby better capturing causal relationships between events. Furthermore, the inclusion of temporal entities in the manually annotated data helps the model learn the association between temporal entities and causal relationships. When annotating the data, temporal entities and causal relationships can be annotated at the sentence or segment level, so that the model learns the importance of temporal entities for causal relationship extraction.

[0102] In summary, this paper proposes a BERT-BiLSTM-CRF causal relationship extraction method that integrates the time feature matrix. Figure 8 This is the model architecture diagram. Figure 9 The following is the operational process of the model. In the extraction of causal relationships from urban underground space disaster events, BERT is used to encode words in text sequences into semantically rich word vectors. Through pre-training, BERT can understand the contextual semantics of words, thereby better capturing the complex semantic features of event causal relationships. By adding time feature vectors to the word vectors output by BERT, it can better utilize temporal entities to capture causal phrases. BiLSTM is used to further process the word vectors extracted by BERT to obtain more representative text representations. BiLSTM can transfer information forward and backward along the temporal dimension to better understand the dependencies and structures in text sequences. CRF is used to model the labels of the BiLSTM output sequence. CRF can use contextual information to model the dependencies between adjacent labels, thereby more accurately identifying event causal relationships.

[0103] Simply put, the word embeddings output by BERT, combined with the temporal feature matrix, provide rich contextual information based on temporal relationships. BiLSTM, building on BERT, further captures the local contextual features of sequence data. CRF, incorporating global contextual information, predicts labels for the sequence and outputs the results. This fusion model design can better handle complex event causal relationship extraction tasks and achieve improved performance.

[0104] 1.2.3 Experimental results and evaluation

[0105] Under the premise of the same experimental environment, the model parameter settings are shown in Table 6. The data volume after causal relationship annotation is 2.2MB, which contains about 150 underground space disaster events. It is divided into training set, validation set and test set with a ratio of 8:1:1 and the experiment is carried out.

[0106] Table 6 Parameter settings

[0107]

[0108] Table 7 shows the experimental results of a causal relationship extraction model (BERT-T-BiLSTM-CRF) that integrates a temporal feature matrix and contextual relationships. The precision, recall, and F1 score for the three labels, Cause, Result, and Other, are listed in the table. As shown in Table 7, the recognition accuracy for cause and result phrases is high, reaching up to 87.73%. The recognition accuracy for sentences excluding causal relationships reaches 95.49%.

[0109] Table 7 Results of the causal relationship experiment

[0110]

[0111] To validate the advantages of this model, comparative experiments were conducted using the BiLSTM-CRF model, a currently popular model suitable for causal relationship extraction from Chinese text data, as well as the ALBERT-BiLSTM-CRF and BERT-BiLSTM-CRF models mentioned previously. Table 8 shows the experimental results of the four models on urban underground space disaster data, using the same parameter settings. Table 8 shows that: 1) Incorporating a pretrained model generally improves model accuracy; 2) The ALBERT-BiLSTM-CRF model is less accurate than the BERT-BiLSTM-CRF model. Although the ALBERT model reduces the number of parameters by sharing parameters, potentially better capturing the characteristics of the input data, this characteristic can lead to higher accuracy than the BERT model in certain specific datasets; 3) The BERT-BiLSTM-CRF model, which incorporates temporal features, achieves significantly higher accuracy than the BERT-BiLSTM-CRF model without them, achieving an average precision of 89.46%, a recall of 88.32%, and an F1 score of 88.89%. Experimental results show that the model proposed in this paper improves the extraction effect of causal relationships of urban underground space disaster events by adding temporal relationships.

[0112] Table 8 Model comparison experimental results

[0113]

[0114] In summary, causal relationships are an important type of relationship in text mining. Sequence labeling can be used to identify entities with causal relationships. Considering the connection between temporal and causal relationships, this paper integrates a special temporal matrix into the BERT-BiLSTM-CRF network model to conduct experiments and accurately label causal relationships. The experimental results show that adding a special temporal matrix improves the accuracy of causal relationship extraction. The proposed causal relationship extraction method, which integrates the temporal feature matrix and contextual relationships, can effectively capture the causal relationships contained in urban underground space disaster events.

[0115] 1.4.3 Summary

[0116] This paper primarily studies knowledge extraction methods for urban underground space disaster data and proposes two improved knowledge extraction models. First, the ALBERT-BiLSTM-CRF entity extraction model is proposed. This model adds time entities, underground space location entities, underground space disaster entities, and disaster loss entities to the basic entities. This model achieves impressive results on an urban underground space disaster dataset, achieving a precision of 95.41%, a recall of 94.08%, and an F1 score of 94.74%. This model outperforms some commonly used named entity recognition methods and provides a valuable reference for named entity recognition tasks related to urban underground space neighborhoods. Second, a causal relationship extraction method based on the BERT-BiLSTM-CRF model, which incorporates temporal features on the basis of the BERT-BiLSTM-CRF neural network, is proposed. This model improves the accuracy of causal relationship identification for urban underground space disaster events, achieving average precision, recall, and F1 scores of 89.46%, 88.32%, and 88.89%, respectively. This model demonstrates its advantages in extracting causal relationships from urban underground space disaster events.

[0117] An embodiment of the present invention also provides an electronic device. The electronic device includes: at least one processor, and a memory communicatively connected to the at least one processor, wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to cause the at least one processor to perform the method described. Specifically, the above-mentioned memory and processor are connected together via a bus and can be general-purpose memory and processor, which are not specifically limited here. When the processor runs the computer program stored in the memory, it can perform the various operations and functions described in the embodiments of the present invention.

[0118] The embodiment of the present invention further provides a storage medium having a computer program stored thereon, which, when executed by a processor, implements the method described above. Specific implementations can be found in the method embodiment and will not be described in detail here.

[0119] Although the embodiments of the present invention have been disclosed above, they are not limited to the applications listed in the description and embodiments. They can be applied to a variety of fields suitable for the embodiments of the present invention. Those skilled in the art will readily realize further modifications. Therefore, without departing from the general concept defined by the claims and their equivalents, the embodiments of the present invention are not limited to the specific details and illustrations shown and described herein.

Claims

1. A method for extracting event causal relationships based on contextual temporal relationships, characterized in that: include: Entity extraction is performed on Chinese text data of urban underground space disasters to obtain time entities; Annotating the cause-effect relationship of the Chinese text data of the urban underground space disaster; The Chinese text data of disasters with causal relationship annotations were input into the BERT-BiLSTM-CRF model to extract the causal relationship of urban underground space disaster events. Among them, when the BERT layer in the BERT-BiLSTM-CRF model outputs a word vector, the encoding vector of the time entity is concatenated with the word vector output by the BERT layer to obtain a word vector containing a time relationship, and then the word vector containing the time relationship is input into the BiLSTM layer for processing.

2. The event causal relationship extraction method based on contextual time relationship as claimed in claim 1, characterized in that: Also includes: Before performing entity extraction on the Chinese text data of urban underground space disasters, the Chinese text data of urban underground space disasters is screened and pre-processed for noise reduction, the Chinese text data of disasters used for entity extraction is retained, and then word segmentation and labeling operations are performed. During the labeling operation, all time-related information is labeled as an entity type to obtain a time entity labeling data set; When the Chinese text data of the urban underground space disaster is annotated with a causal relationship, the time entity annotation data set is superimposed to obtain the disaster text data with the causal relationship annotation of the time entity added; The disaster text data with the causal relationship annotations of the time entity is input into the BERT-BiLSTM-CRF model to complete the extraction of the causal relationship of urban underground space disaster events.

3. The event causal relationship extraction method based on contextual time relationship as claimed in claim 1, characterized in that: The method for labeling the causal relationship of the Chinese text data of the urban underground space disaster includes: First, the Chinese text data of urban underground space disasters are screened and pre-processed for noise reduction, and the Chinese text data of disasters used for relationship extraction is retained. Then, the word segmentation operation is performed, and then the semi-supervised learning method is used to annotate the causal relationship. The manually annotated text data set is input into the LTP tool for learning, and then the LTP tool annotates the remaining data sets. The causal relationship annotation adopts the BIO annotation rule to annotate the trigger words representing the causal relationship, and annotate the causal entity introduced by each trigger word as "BX", "IX" or "O", where "BC" indicates that the position of the character is the starting part of the cause fragment, "IC" indicates that the position of the character is the non-starting position of the cause fragment, "BR" indicates that the position of the character is the starting part of the result fragment, "IR" indicates that the position of the character is the non-starting position of the result fragment, and "O" indicates that the element does not belong to any of the above types.

4. The event causal relationship extraction method based on contextual time relationship as claimed in claim 1, characterized in that: The word vector containing the time relationship then enters the BiLSTM layer, and the BiLSTM layer uses the time relationship to perform forward and reverse information processing on it, and then uses the CRF component to model the label of the text sequence output by the BiLSTM component.

5. The event causal relationship extraction method based on contextual time relationship as claimed in claim 2, characterized in that: When the disaster Chinese text data for entity extraction is annotated, the BIO part-of-speech tagging method is adopted, wherein "B" represents the start node of the entity, "I" represents all sequence labels after the start node, and the LTP tool is used for part-of-speech tagging, and the entity types are abstracted into five categories, namely "LOC", "PER", all time-related information, "ORG" and "DIS"; The disaster Chinese text data processed as above is input into the ALBERT-BiLSTM-CRF model to complete entity extraction.

6. The event causal relationship extraction method based on contextual time relationship as claimed in claim 1, characterized in that: The Chinese text data on urban underground space disasters are selected from text data on flood disasters and pipeline accident disaster events in urban underground spaces.

7. An event causal relationship extraction device based on contextual time relationship, characterized in that: include: Relationship extraction preprocessing module, which is used to annotate the causal relationship of Chinese text data on urban underground space disasters; The BERT-BiLSTM-CRF model is used to extract event causal relationships from input Chinese text data of disasters that have been annotated with causal relationships. When the BERT layer in the BERT-BiLSTM-CRF model outputs a word vector, the encoding vector of the time entity of the Chinese text data of urban underground space disasters is concatenated with the word vector output by the BERT layer to obtain a word vector containing a time relationship, and then the word vector containing the time relationship is input into the BiLSTM layer.

8. The event causal relationship extraction device based on contextual time relationship as claimed in claim 1, characterized in that: Also includes: An entity extraction preprocessing module is used to label the Chinese text data of urban underground space disasters according to entity type classification, where one entity type is all time-related information, and obtain a time entity labeling data set; When the relationship extraction preprocessing module performs causal relationship annotation on the urban underground space disaster Chinese text data, the time entity annotation data set is superimposed to obtain disaster text data with causal relationship annotation of the time entity added; The BERT-BiLSTM-CRF model is used to extract event causal relationships from the input disaster text data with causal relationship annotations of time entities.

9. An electronic device, characterized in that: include: At least one processor, and a memory communicatively connected to the at least one processor, wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor performs the method according to any one of claims 1 to 6.

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

Citation Information

Patent Citations

  • Method for extracting causal relationship contained in text based on time relationship

    CN112463970A

  • Method and system for extracting causal relationship of text based on time relationship

    CN114548112A

  • Chinese event trigger word extraction method based on multi-feature fusion

    CN116521839A

  • Financial causal relationship chain construction method based on text core information extraction

    CN116596072A

  • Method and system for extraction of cause-effect relation from domain specific text

    US20220207400A1

Cited By

  • Denoising causal relationship extraction method and device based on multi-task collaborative learning

    CN119272765A

  • Denoising causal relation extraction method and device based on multi-task cooperative learning

    CN119272765B

  • Method, device and equipment for identifying event causal relationship of Chinese text

    CN119720951A