A joint extraction method for civil aviation unsafe events based on soft parameter sharing
Through the method based on soft parameter sharing, the problems of error propagation and insufficient information interaction in civil aviation unsafe event extraction are solved, efficient and accurate event extraction is achieved, the seesaw phenomenon is alleviated, and the effect of event extraction in the civil aviation field is improved.
Patent Information
- Application Number
- CN202210848785.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-19
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2042-07-19
AI Technical Summary
Existing technologies have problems with error propagation and insufficient information interaction in the extraction of civil aviation unsafe events, and event extraction methods in general fields cannot meet the needs of the civil aviation field, resulting in poor extraction results.
Adopting a joint extraction method of civil aviation unsafe events based on soft parameter sharing, by building an event extraction data set and model for the civil aviation field, using a double-layer gating network and a CRF network for feature extraction and decoding, and dynamically weighted losses to balance task differences , to achieve information sharing and joint representation learning.
It improves the efficient and accurate extraction of civil aviation unsafe events, alleviates the seesaw phenomenon, enhances the model's prediction capabilities and information sharing capabilities, and improves the final extraction effect.
Smart Images

Figure CN115114409B
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of natural language processing, and in particular relates to a joint extraction method of civil aviation unsafe events based on soft parameter sharing. Background Art
[0002] Event extraction is an important topic in information extraction research and is the basis for applications such as recommendation systems, intelligent question answering, and knowledge graph construction. As a specific form of information, an event refers to the specific occurrence of something at a specific time and place, involving one or more participants, and can usually be described as a change in state. The main purpose of the event extraction task is to extract such event information such as event trigger words and arguments from unstructured text into a structured form. Event extraction includes two subtasks, namely event recognition task and argument role classification task. The main elements of the task include event trigger words, event types, event arguments, and argument roles.
[0003] According to the "Summary of China's Civil Aviation Development in 2020", the average number of domestic flights has reached 300,000 per month. As the number of flights increases, the number of unsafe incidents in civil aviation is also increasing. At present, the information extraction and recording of most unsafe incidents rely heavily on manual work, which results in high labor costs. Taking bird strike unsafe incidents as an example, for a bird strike event description text, it is necessary to manually fill in the time, location, corresponding flight number, bird strike part and other event information of the bird strike into the form, which is time-consuming and labor-intensive, and it is impossible to uniformly extract a large amount of event data at the same time and then form structured data, which also hinders the further use of event information in the construction of event maps in the civil aviation field. Event maps have been proven to be of great significance to many fields, such as risk event monitoring, enriching existing knowledge maps, and combing historical events to facilitate the query of historical events. Therefore, how to efficiently and accurately extract more and more civil aviation unsafe incidents is an increasingly urgent problem to be solved.
[0004] In recent years, with the development of deep learning, most of the research on event extraction algorithms is based on the architecture of deep learning. At present, deep learning methods such as CNN, RNN, LSTM, BERT have achieved good results in event extraction tasks. However, the data used in most current research work often come from events in general fields. At the same time, due to the high cost of manual annotation, the scale of commonly used event extraction public data sets is small, while the scope of general fields involved is large and the event types are numerous and complex. Therefore, the final effect of event extraction methods in general fields in the commonly used public data set ACE2005 in recent years cannot meet the needs of civil aviation unsafe event extraction. However, for civil aviation unsafe events, it belongs to events in a limited field. For event data in a limited field, the event text type is more single, the language representation is more regular, and the knowledge is more intensive. Therefore, some research methods in general fields in recent years have achieved considerable results in event extraction tasks in specific fields such as financial events and medical events, which also provides support for the feasibility of event extraction in the civil aviation field.
[0005] The neural network model constructed in the event extraction method based on deep learning is mainly divided into two categories according to different extraction paradigms, namely pipeline-based and joint-based extraction models. The pipeline-based model first extracts trigger words to complete the event recognition task, and then extracts arguments to complete the argument role classification task. However, this method often has two shortcomings: first, error propagation. The errors generated by the event recognition task in the first stage cannot be corrected in the next stage, which in turn affects the argument role classification task in the second stage. Secondly, there is a lack of information interaction. The two subtasks of event recognition and argument role classification are interdependent. The pipeline method often ignores the information interaction between the two tasks, and the tasks cannot benefit each other, which in turn affects the final extraction effect. The joint-based method is to jointly model the two tasks to simultaneously complete the event recognition and argument role classification tasks. In recent years, most joint extraction models mainly use the hard parameter sharing method in multi-task learning. The two tasks completely share the same underlying network, and then connect the network layers of the two tasks respectively. This joint extraction method can reduce the impact of error propagation, and the two tasks are trained together to jointly update the entire network parameters, which strengthens the information interaction between the two tasks and improves the final task effect. However, due to the differences between the two subtasks of event extraction, the same network that is fully shared in the joint extraction model tends to tend to more complex tasks (the argument role classification task is more complex than the event recognition task), so there will be a seesaw phenomenon in multi-task learning (the effect of one subtask is improved, and the effect of the other subtask is reduced). Multi-Task Learning (MTL) refers to using a single model to learn multiple tasks at the same time, and improving the effects of multiple tasks at the same time by sharing information between tasks. According to the different sharing methods, the multi-task learning model is generally divided into hard parameter sharing model and soft parameter sharing model. Compared with hard parameter sharing, the soft parameter sharing model does not completely share the same underlying network but encourages parameter similarity. Under the premise of ensuring parameter sharing between tasks, the shared network layer can better serve the downstream structure of the two tasks and thus improve the effects of multiple tasks at the same time, alleviating the occurrence of the seesaw phenomenon. Summary of the invention
[0006] In view of this, the present invention aims to propose a method for joint extraction of civil aviation unsafe events based on soft parameter sharing. The present invention improves on the method of joint extraction of events in general fields, constructs an event extraction dataset for civil aviation unsafe events, and reduces the impact of traditional hard parameter sharing methods based on multi-task learning on the performance of the entire model, thereby ultimately completing the efficient and accurate extraction of civil aviation unsafe events.
[0007] To achieve the above object, the technical solution of the present invention is achieved as follows:
[0008] A joint extraction method for civil aviation unsafe events based on soft parameter sharing includes the following steps:
[0009] S1: Collect text data of unsafe events in the civil aviation field, pre-process these data, and use them to construct an event extraction dataset. The dataset format is a data file processed in Json format, and is divided into training set, validation set, and test set in a ratio of 8:1:1.
[0010] S2: Process each event data in Json format in the divided data set to obtain the input format and corresponding label data required by the model.
[0011] S3: Establish a joint extraction model of civil aviation unsafe events based on soft parameter sharing, including embedding layer, encoding layer, and decoding prediction layer;
[0012] S4: Randomly send the processed input model data in batches of batchsize into the constructed civil aviation unsafe incident joint extraction model based on soft parameter sharing for iterative training, and verify the effect of the model with the validation set after each training epoch. The evaluation indicators are accuracy, recall and F1 value. If the F1 value of event recognition and argument role classification is greater than the F1 value of the previous round of training, save the model and set early stopping. If the F1 value does not increase after a certain number of iterations, stop training and save the optimal model on the validation set.
[0013] S5: Take the optimal model saved in the end as the target model, send the test set samples into the target model in batches, and output and save the extracted results.
[0014] Furthermore, for the collection of unsafe incident text data in the civil aviation field as described in S1, the data are preprocessed to construct an event extraction data set. The specific steps are as follows:
[0015] S11: The collected civil aviation unsafe incident texts are annotated according to pre-defined event types, and the sentences containing these event types are annotated with specific event types.
[0016] S12: Label the argument roles and arguments according to the event frameworks defined for different event types.
[0017] S13: The final dataset is in the processed Json format and is divided into training, validation and test sets in a ratio of 8:1:1. Each processed data in the dataset includes the original event sentence, event type, trigger word, trigger word starting position index, argument, argument starting position index and argument role type.
[0018] Furthermore, as for S2, each event data in Json format in the divided data set is processed to obtain the input format and corresponding label data required by the model:
[0019] S21: Process the training set, validation set, and test set into tsv format files for event recognition and tsv format files for argument role classification, respectively.
[0020] S22: Process the tsv format file into the input format and corresponding label data required by the pre-training model. The processing steps for obtaining the input data required by the model include: dividing the input sentence into character-level sequences, and processing it through the tokenzier method, and processing it into input data containing input_ids, token_type_ids, attention_mask and processed label data and sending them to the model together.
[0021] Furthermore, the specific implementation steps of the joint extraction model of civil aviation unsafe events based on soft parameter sharing described in S3 include:
[0022] S31: Map the input event sentence into a word-level embedding vector representation through the embedding layer.
[0023] S32: The vector representation is input into the shared network, private network, and gated network in the encoding layer respectively to perform feature extraction and feature fusion to obtain the feature representations of the two tasks.
[0024] S33: Input into the decoding prediction layer of the two tasks respectively, decoded by Conditional Random Field (CRF), and select the global best label sequence at the sentence level from all possible sequence labels as the final output.
[0025] Furthermore, for the embedding layer of step S31, ChineseBERT is used as a pre-training model to obtain the embedding vector representation of the character set of the input sequence. The character shape and pinyin information are integrated into the pre-training stage, which is more suitable for the natural language processing task of Chinese. The character vector representation of the input text is obtained through ChineseBERT as the feature input of the encoding layer; ChineseBERT incorporates the character shape and pinyin information in the pre-training stage, which is more suitable for the natural language processing task of Chinese. The character vector representation of each event sentence is obtained through ChineseBERT as the feature input of the encoding layer.
[0026] Further, for the step S32, the encoding layer mainly includes a shared network, a private network, and a gated network, and the encoding layer is divided into a shared network layer and a private-shared network layer according to the gated network; the shared network is composed of a group of fully connected networks as its sub-networks, and the character-level embedding vector obtained by the embedding layer is used as input and input into each sub-network respectively, so as to obtain the shared knowledge of the two tasks, and the two tasks filter the knowledge learned by this group of shared networks through the gated networks of their respective first layers and then use it as the shared knowledge learned by their respective tasks; the private layer is a network layer exclusive to the two tasks, and the BiGRU network is used as the private network of the two tasks respectively, so as to capture the dependency between characters, and the extracted feature vector representation and the feature vector representation extracted by the first layer of the shared network are selectively fused through the second layer of the gated network, wherein the gated network is a weighted function that calculates the weight vector through linear changes and softmax layers, and the first layer learns the weight value of the output feature of each sub-network of the shared network based on the input of the embedding layer, and the second layer learns the weight value of the output feature of the private network and the output feature of the shared network layer; finally, the feature representation of the output of the encoding layer of each task is output to the decoding prediction layer of the next layer.
[0027] Furthermore, the decoding prediction layer of step S33 mainly includes a fully connected network and a CRF network, and both tasks adopt a sequence labeling method; usually, a softmax classifier is selected in the prediction stage to solve the multi-classification problem, but the softmax classifier cannot take into account the dependency between labels in the sequence labeling problem, such as the first label of a trigger word or an argument starts with B- instead of I-, and for a group of continuous trigger words or argument labels, they are generally of the same type, etc.; the CRF model can consider the constraint relationship between labels through the transfer matrix to obtain the globally optimal sequence label. In the decoding prediction stage, the Viterbi dynamic programming algorithm is used to solve the label sequence with the highest total score as the optimal sequence.
[0028] Furthermore, for the iterative training process described in step S4, in order to better balance the differences between the two tasks in the training process and make the training speeds of the two tasks as consistent as possible, this paper adopts a dynamic weighted approach to assign new loss weights to the two tasks in each round of training. This method learns the weight value of each task by considering the rate of change of the loss, and finally adds the weighted task losses as the total loss.
[0029] Furthermore, for the batch feeding of the test set samples into the target model as described in S5, and outputting and saving the extracted results, the specific steps are as follows:
[0030] S51: Input the event sentences in the test set into the saved optimal model in batches, and output the optimal sequence predicted for the event recognition task and the optimal sequence predicted for the argument role classification task, both in Json format files.
[0031] S52: The two results are combined to obtain an event knowledge file containing a complete structured form.
[0032] Compared with the prior art, the joint extraction method of civil aviation unsafe events based on soft parameter sharing described in the present invention has the following advantages:
[0033] (1) The present invention clearly separates shared parameters and task-specific parameters through soft parameter sharing, and enhances the model's ability to extract and filter semantic knowledge through a double-layer gating network, so that the model can learn appropriate feature representations for two tasks at the same time, achieving more efficient information sharing and joint representation learning, and effectively alleviating the occurrence of the seesaw phenomenon;
[0034] (2) The present invention uses the CRF network in the decoding prediction layer to consider the constraint relationship between labels through the transfer matrix to obtain the global optimal sequence label, which effectively improves the prediction effect of the model;
[0035] (3) In order to better balance the differences between the two tasks during the training process and make the training speeds of the two tasks as consistent as possible, the present invention uses a dynamic weighting method to assign new loss weights to the two tasks in each round of training to help the tasks train to the optimal results at the same time. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] The accompanying drawings constituting a part of the present invention are used to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the accompanying drawings:
[0037] Figure 1 It is a schematic diagram of the method of the present invention;
[0038] Figure 2 Extract an instance of a civil aviation unsafe incident;
[0039] Figure 3 The model diagram of joint extraction of civil aviation unsafe time based on soft parameter sharing of the present invention;
[0040] Figure 4 This is the GRU network structure diagram;
[0041] Figure 5 This is the BiGRU network structure diagram. DETAILED DESCRIPTION
[0042] It should be noted that, in the absence of conflict, the embodiments of the present invention and the features in the embodiments may be combined with each other.
[0043] In the description of the present invention, it should be understood that the terms "center", "longitudinal", "lateral", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside" and the like indicate positions or positional relationships based on the positions or positional relationships shown in the accompanying drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as limiting the present invention. In addition, the terms "first", "second", and the like are only used for descriptive purposes, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, features defined as "first", "second", and the like may explicitly or implicitly include one or more of the features. In the description of the present invention, unless otherwise specified, "multiple" means two or more.
[0044] In the description of the present invention, it should be noted that, unless otherwise clearly specified and limited, the terms "installed", "connected", and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium, or it can be the internal communication of two components. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood by specific circumstances.
[0045] The present invention will be described in detail below with reference to the accompanying drawings and in conjunction with embodiments.
[0046] like Figure 1 , 2 As shown, an embodiment of the present invention provides a joint extraction method for civil aviation unsafe events based on soft parameter sharing, including:
[0047] S1: Collect text data of unsafe events in the civil aviation field, pre-process these data, and use them to construct an event extraction dataset. The dataset format is a data file processed in Json format, and is divided into training set, validation set, and test set in a ratio of 8:1:1.
[0048] S2: Process each Json-formatted event data in the divided data set to obtain the input format and corresponding label data required by the model. The training set, validation set, and test set are processed into tsv format files for event recognition and tsv format files for argument role classification respectively; the tsv format files are processed into the input format and corresponding label data required by the pre-training model. The processing steps for obtaining the input data required by the model include: dividing the input sentence into character-level sequences, and processing it through the tokenzier method, and processing it into input data containing input_ids, token_type_ids, attention_mask and processed label data and sending them to the model together.
[0049] S3: The processed input model data is randomly sent to the constructed joint extraction model of civil aviation unsafe events based on soft parameter sharing in batches according to the batchsize size for iterative training, and the effect of the model is verified by the validation set after each training epoch. The evaluation indicators are accuracy, recall and F1 value. If the F1 value of event recognition and argument role classification is greater than the F1 value of the previous round of training, the model is saved and early stopping is set. If the F1 value does not increase after a certain number of iterations, the training is stopped and the optimal model on the validation set is saved; the joint extraction model of civil aviation unsafe events based on soft parameter sharing includes an embedding layer, an encoding layer, and a decoding prediction layer. First, the input event sentence is mapped to a word-level embedding vector representation through the embedding layer, and then the vector representation is respectively input into the shared network, private network, and gated network in the encoding layer for feature extraction and feature fusion to obtain the feature representations of the two tasks. Finally, they are respectively input into the decoding prediction layer of the two tasks, and decoded through the conditional random field (CRF). The global optimal label sequence at the sentence level is selected from all possible sequence labels as the final output.
[0050] S4: Take the optimal model saved in the end as the target model, send the test set samples into the target model in batches, and output and save the extracted results.
[0051] Specifically, in one embodiment, the data preprocessing in S1 includes labeling the collected civil aviation unsafe incident text according to predefined event types, labeling the specific event types for the sentences containing these event types in the text, and labeling the argument roles and arguments according to the event frameworks defined for different event types.
[0052] Specifically, in one embodiment, the final data set format in S1 is a processed Json format data file, and is divided into a training set, a validation set, and a test set in a ratio of 8:1:1; each processed data in the data set includes the original event sentence, event type, trigger word, trigger word starting position index, argument, argument starting position index, and argument role type.
[0053] Specifically, in one implementation, S2 obtains the character vector representation of the input text through ChineseBERT. First, for the input sentence S, the word segmentation sequence T = {t0, t1, ..., t n}∈V c , V c is a character-level vocabulary, where t0 and t n The special characters [CLS] and [SEP] required by ChineseBERT are input, n is the maximum length of the sequence, and each character t i Get an embedded representation through ChineseBERT d is the dimension of the embedding vector:
[0054] x i =Embedding(t i )
[0055] The embedding vector of an event sentence is That is, x={x0,x1,…,x n}
[0056] Specifically, in one embodiment, the shared network in S3 is as follows: Figure 3 As shown, it consists of a group of sub-networks, the parameters of each network are affected by two tasks, and each sub-network is a single-layer fully connected network, which is represented by f i ,i=1,…,m, where m is the number of sub-networks. The output of task k after passing through the first layer of shared network is:
[0057]
[0058] Where k = 1, 2, 1 represents the event recognition task, 2 represents the argument role classification task, the superscript (0) represents the first layer, x is the output vector of the embedding layer, is the weight value of the first layer of the gating network for task k for the output of the i-th sub-network fi(x), It is a weighted function that calculates the weight vector through linear change and softmax layer, expressed as
[0059]
[0060] in is a trainable matrix, m is the number of sub-networks, d is the feature dimension of the input, and n is the length of the input sequence. The output features of the sub-networks of the shared network are selectively fused through the first-layer gating network, so that the two tasks can filter out the information they need from the shared network while ensuring information sharing.
[0061] Specifically, in one embodiment, the private-shared network layer in S3, such as Figure 3 As shown in , the private layers of the two tasks are BiGRU networks, which are convenient for capturing the dependencies between characters. GRU (Gate Recurrent Unit) has the following structure: Figure 4 As shown, its specific working principle can be expressed by the following formulas:
[0062] z t =σ(W z ·[h t-1 ,x t ])
[0063] r t =σ(W r ·[h t-1 ,x t ])
[0064]
[0065]
[0066] Among them, x t is the information input at the current moment, h t-1 is the hidden state of the previous moment, h t is the hidden state passed to the next moment, is the candidate hidden state, r t is the reset gate, z t is the update gate, σ is the sigmoid activation function, which converts the input value to a value between (0,1), and tanh is the tanh activation function, which converts the input value to a value between (-1,1). z , W r , is an updateable parameter matrix.
[0067] Specifically, in one implementation, in order to better capture the bidirectional semantic dependency of text through GRU, the private network in S3 further adopts the BiGRU model, such as Figure 5As shown in the figure, it consists of two unidirectional GRUs. The input sequence is input into the two GRU networks in forward and reverse order for feature extraction. The extracted feature vectors are concatenated as the final network output. The corresponding calculation formula is as follows:
[0068]
[0069]
[0070]
[0071] Specifically, in one implementation, the two tasks in S3 finally learn task-specific feature representations through the BiGRU private network, and selectively fuse the feature representations learned by the shared network layer with the feature representations learned by the second-layer gating network, thereby ensuring that the two tasks can learn as much shared knowledge and private knowledge specific to their respective tasks as possible at the encoding layer. The formula is expressed as follows:
[0072]
[0073] The superscript (1) indicates the second layer. is the weight value of the second-layer gating network of task k on the output feature of the BiGRU private network, is the weight value of the second-layer gating network of task k on the shared network output feature, H k is the feature representation vector learned by the BiGRU network, Feature representation vector learned by the shared network layer.
[0074] Specifically, in one implementation, the decoding prediction layer in S3 mainly includes a linear layer and a CRF layer. For one of the tasks, the output sequence Z of the linear layer is {z1, z2, …, z n}, the label sequence output by CRF is Y = {y1,y2,…,y n}, the total score of the label sequence is:
[0075]
[0076] Where T is the transfer score matrix, Indicates that label yi is transferred to label y i+1 The transfer score, Indicates that the i-th word is in label y i The output score under is the score of each possible output label sequence, so the probability distribution of the output sequence Y is as follows:
[0077]
[0078] where Y Z For all possible label sequences of sequence Z, the optimization goal of the CRF layer is to maximize the proportion of the score of the true label sequence to the total score. Therefore, during the training process, the correct label sequence Y is maximized. * The log-likelihood estimate of S(Z,Y * ) is the score of the correct label sequence output, as shown below:
[0079]
[0080] Then the loss function of each task is defined as
[0081] Loss = -log(P(Y * |Z))
[0082] In the decoding prediction stage, the Viterbi dynamic programming algorithm is used to solve the label sequence with the highest total score as the optimal sequence.
[0083] Specifically, in one embodiment, in the iterative training process described in S4, in order to better balance the differences between the two tasks in the training process and make the training speeds of the two tasks as consistent as possible, this paper adopts a dynamic weighting method to assign new loss weights to the two tasks in each round of training. This method learns the weight value of each task by considering the rate of change of the loss, and finally adds the weighted task losses as the total loss. The formula is as follows:
[0084]
[0085]
[0086]
[0087] Where e represents the number of training rounds epoch, r k is the ratio of the last round of training loss of task k to the previous round of training loss, representing the update rate of the last round of loss. When epoch is 0 or 1, r k The value is 1; l k is the average loss for each epoch, is the loss weight of task k, which is calculated by k After softmax normalization, multiply by 2 to obtain Loss Trigger The loss of the current training event recognition task, Loss Argument is the loss for the argument corner classification task.
[0088] Specifically, in one implementation, S4 describes sending the test set samples into the target model in batches, outputting and saving the extracted results, and the specific steps are: 1. Batch inputting the event sentences in the test set into the saved optimal model, and outputting the optimal sequence predicted for the event recognition task and the optimal sequence predicted for the argument role classification, respectively, both of which are Json format files; 2. Merging the two results to obtain an event knowledge file containing a complete structured form.
[0089] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A joint extraction method for civil aviation unsafe events based on soft parameter sharing, characterized by: The steps include: S1: Collect text data of unsafe events in the civil aviation field, pre-process these data, and use them to construct an event extraction dataset. The dataset format is a data file processed in Json format and divided into training set, validation set, and test set in a ratio of 8:1:1; S2: Process each Json-formatted event data in the divided data set to obtain the input format and corresponding label data required by the model; S3: Establish a joint extraction model of civil aviation unsafe events based on soft parameter sharing, including embedding layer, encoding layer, and decoding prediction layer; The embedding layer uses ChineseBERT as a pre-trained model to obtain the embedding vector representation of the character set of the input sequence. The character vector representation of the input text is obtained through ChineseBERT as the feature input of the encoding layer. The character vector representation of each event sentence is obtained through ChineseBERT as the feature input of the encoding layer. The encoding layer includes a shared network, a private network and a gating network, and the encoding layer is divided into a shared network layer and a private-shared network layer according to the gating network; the shared network is composed of a group of fully connected networks as its sub-networks, and the character-level embedding vectors obtained by the embedding layer are used as inputs and input into each sub-network respectively to obtain the shared knowledge of the two tasks. The two tasks filter the knowledge learned by this group of shared networks through their respective first-layer gating networks and then use it as the shared knowledge learned by their respective tasks. The private layer is a network layer exclusive to the two tasks, and the BiGRU network is used as the private network of the two tasks respectively. The extracted feature vector representation and the feature vector representation extracted by the first-layer shared network are selectively fused through the second-layer gating network, and finally used as the feature representation of the output of the encoding layer of each task, and output to the decoding prediction layer of the next layer; The decoding prediction layer includes a fully connected network and a CRF network. Both tasks use sequence labeling. In the decoding prediction stage, the Viterbi dynamic programming algorithm is used to solve the label sequence with the highest total score as the optimal sequence. The implementation process of the joint extraction model of civil aviation unsafe events based on soft parameter sharing is as follows: S31: Map the input event sentence into a word-level embedding vector representation through the embedding layer; S32: The vector representation is input into the shared network, the private network, and the gated network in the encoding layer respectively to perform feature extraction and feature fusion to obtain feature representations of the two tasks; S33: Input into the decoding prediction layer of the two tasks respectively, decode through the conditional random field, and select the global best label sequence at the sentence level from all possible sequence labels as the final output; S4: Randomly send the data processed by S2 in batches of batchsize into the constructed joint extraction model of civil aviation unsafe events based on soft parameter sharing for iterative training, and use the validation set to verify the effect of the model after each training epoch. The evaluation indicators are accuracy, recall and F1 value. If the F1 value of event recognition and argument role classification is greater than the F1 value of the previous round of training, save the model and set early stopping. If the F1 value does not increase after a certain number of iterations, stop training and save the optimal model on the validation set. S5: Take the optimal model saved in the end as the target model, send the test set samples into the target model in batches, and output and save the extracted results.
2. According to claim 1, a joint extraction method of civil aviation unsafe events based on soft parameter sharing is characterized by: The S1 specifically includes S11: the collected civil aviation unsafe incident texts are classified into pre-defined event types, and specific event types are marked for sentences containing these event types in the texts; S12: Label the argument roles and arguments according to the event frameworks defined for different event types; S13: The final dataset is in the processed Json format and is divided into training set, validation set, and test set in a ratio of 8:1:
1. Each processed data in the dataset includes the original event sentence, event type, trigger word, trigger word starting position index, argument, argument starting position index, and argument role type.
3. The method for jointly extracting civil aviation unsafe events based on soft parameter sharing according to claim 1 is characterized in that: The S2 specifically includes S21: Process the training set, validation set, and test set into tsv format files for event recognition and tsv format files for argument role classification respectively; S22: Process the tsv format file into the input format and corresponding label data required by the pre-training model. The processing steps for obtaining the input data required by the model include: dividing the input sentence into character-level sequences, and processing it through the tokenzier method to process the input data containing input_ids, token_type_ids, attention_mask and the processed label data into the model together.
4. The method for jointly extracting civil aviation unsafe events based on soft parameter sharing according to claim 1 is characterized in that: The gating network in S3 calculates the weighted function of the weight vector through linear changes and softmax layers. The first layer learns the weight value of each sub-network output feature of the shared network based on the input of the embedding layer, and the second layer learns the weight value of the output feature of the private network and the output feature of the shared network layer.
5. The method for jointly extracting civil aviation unsafe events based on soft parameter sharing according to claim 1 is characterized in that: In S4, the iterative training process uses a dynamic weighted approach to assign new loss weights to the two tasks in each round of training. The weight value of each task is learned by considering the rate of change of the loss, and finally the weighted task losses are added together as the total loss.
6. The method for jointly extracting civil aviation unsafe events based on soft parameter sharing according to claim 1 is characterized in that: The S5 specifically includes S51: Input the event sentences in the test set into the saved optimal model in batches, and output the optimal sequence predicted for the event recognition task and the optimal sequence predicted for the argument role classification task, both in Json format files; S52: The two results are combined to obtain an event knowledge file containing a complete structured form.
