Earthquake emergency plan named entity recognition method and system
By combining a decoupled attention mechanism and a temporal neural network with adaptive gating weights, and using a hybrid transition matrix to model the dependencies between labels, the problem of complex entity recognition in earthquake emergency response plan texts was solved, achieving high-precision named entity recognition.
Patent Information
- Application Number
- CN202511713889.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-21
- Publication Date
- 2026-02-13
- Estimated Expiration
- 2045-11-21
AI Technical Summary
Earthquake emergency response plans often contain dense technical terms, ambiguous entity boundaries, and numerous long and nested entities, making it difficult for existing named entity recognition technologies to quickly and accurately extract key information from the text.
A decoupled attention mechanism is adopted to separate content and position attention, combined with a temporal neural network to capture semantic features, adaptive gating weights are used to fuse target semantics and temporal features, a hybrid transition matrix is used to model the dependency relationship between tags, the Viterbi algorithm is used to predict the tag sequence, and entity types are labeled based on BIO rules.
It improves the recognition accuracy of complex entities in earthquake emergency response plan texts, enhances the ability to identify long-distance dependent and nested entities, and strengthens the robustness of the model to adversarial data and the accuracy of entity boundary recognition.
Smart Images

Figure SMS_67 
Figure SMS_68 
Figure SMS_72
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the technical field of entity recognition, and particularly relates to a method and system for naming entity recognition of earthquake emergency plan. BACKGROUND
[0002] An earthquake emergency plan is an important guiding document for coping with earthquake disasters by making detailed plans for organizational structure, response process, resource allocation, etc. With the increasing richness and complexity of the content of the earthquake emergency plan, a large amount of entity information is covered, such as organization name, personnel, emergency task, response measure, etc. These massive and complex information make it extremely challenging to quickly and accurately obtain key information from the plan text.
[0003] As a technology in the field of natural language processing, naming entity recognition can automatically identify entities with specific meanings from text and classify them into predefined categories. For example, the prior art railway emergency plan intelligent management method based on naming entity recognition improves management level; there is also an analysis of landslide text characteristics, construction of landslide disaster corpus and verification of entity recognition model effect.
[0004] In view of the problems of intensive professional terms, fuzzy entity boundaries, many long entities and nested entities in the earthquake emergency plan text, how to apply the naming entity recognition technology to the earthquake emergency plan text processing is a big problem. SUMMARY
[0005] To solve the problems in the background art, the application provides a method and system for naming entity recognition of earthquake emergency plan.
[0006] The technical scheme of the application is as follows:
[0007] The application provides a method for naming entity recognition of earthquake emergency plan, comprising:
[0008] S1: The to-be-processed earthquake emergency plan text data is divided into sentence-level text according to a preset delimiter; each character in the sentence-level text is processed by decoupling attention, the attention score of the current character and the context character is calculated, and the attention weight matrix is obtained; the context semantic feature matrix is obtained by weighting and summing the context characters using the attention weight matrix; the context semantic feature matrix is fused with the absolute position vector of each character to generate the target semantic feature; the target semantic feature is processed by a time sequence neural network to obtain the time sequence feature;
[0009] S2: After the target semantic feature and the time sequence feature are spliced in the feature dimension, the adaptive gating weight is generated by linear transformation and activation function processing; the target semantic feature and the time sequence feature are fused using the adaptive gating weight to obtain the intermediate feature; the intermediate feature is processed by linear processing to obtain the fusion feature;
[0010] S3: After feature extraction, the enhanced features of each character are obtained by fusing the features. Each character is concatenated with its own enhanced features and the enhanced features of the context characters to obtain three-dimensional context features. These features are then mapped to a dynamic transition matrix through linear transformation and fused with a preset static transition matrix using learnable weights to form a hybrid transition matrix.
[0011] Based on the hybrid transition matrix and fusion features, the probability of a sequence ending with a preset label is calculated position by position using the forward algorithm. Then, the Viterbi algorithm is used to recursively calculate and backtrack position by position. The label sequences of the complete character sequences with the highest probability are combined as the predicted label sequences. The predicted label sequences are then parsed to identify the entity type.
[0012] The preset labels are entity types based on BIO rules, and the entity types are people, organizations, or tasks.
[0013] S2 describes the use of adaptive gating weights to fuse target semantic features and temporal features to obtain intermediate features, which are derived from the formula: To achieve;
[0014] In the formula, , , They represent the first t The intermediate features, temporal features, and target semantic features of each character; Represented as the first t Adaptive gating weights generated from individual characters.
[0015] The S3 transition matrix, fused with the preset static transition matrix using learnable weights, forms a hybrid transition matrix, which is derived from the formula: To achieve;
[0016] In the formula, , , These represent the hybrid transition matrix, the preset static transition matrix, and the dynamic transition matrix, respectively. This represents the learnable weights constrained to [0,1] by the Sigmoid function.
[0017] In the sentence-level text described in S1, each character undergoes decoupled attention processing. The attention score between the current character and the context characters is calculated to obtain the attention weight matrix, specifically:
[0018] In sentence-level text, each character undergoes decoupled attention processing, separating the content vector and relative position vector of each character. Attention scores are calculated for the content vector and relative position vector of the current character and the context characters, as well as for the content vector and relative position vector. These three types of attention scores are then fused, normalized, and the attention weight matrix is obtained.
[0019] Furthermore, through the formula: and is achieved by;
[0020] wherein, denotes an attention weight matrix; denotes a position i content vector projection; denotes a position j content vector projection; denotes a position i relative position vector projection with respect to the position j ; denotes a position j relative position vector projection with respect to the position i ; denotes a position i and j relative position; k denotes a maximum relative distance threshold.
[0021] S3 is achieved by calculating the sequence probability of the character position ending with the preset label by the forward algorithm based on the hybrid transition matrix and the fusion feature, position by position, as follows: ;
[0022] wherein, , denote the sequence probability of the first t characters ending with the preset label v , and the sequence probability of the first t -1 characters ending with the preset label u , respectively; K denotes the number of categories of the preset label; denotes a hybrid transition matrix; denotes an emission score.
[0023] S3 is achieved by calculating and backtracking the label sequence combination of the complete character sequence with the maximum probability by the Viterbi algorithm, position by position, as the predicted label sequence, as follows: ;
[0024] wherein, , denote the maximum probability of the first t characters ending with the preset label v , and the maximum probability of the first t -1 characters ending with the preset label u , respectively; K denotes the number of categories of the preset label; denotes a hybrid transition matrix; denotes an emission score.
[0025] The fusion feature is sequentially subjected to linear processing, GELU activation function processing, linear processing and layer normalization to obtain the enhanced feature of each character.
[0026] The fusion feature is sequentially subjected to linear processing, GELU activation function processing, linear processing and layer normalization to obtain the enhanced feature of each character.
[0027] The application also provides a seismic emergency plan named entity recognition system, comprising:
[0028] The feature extraction module: the to-be-processed seismic emergency plan text data is divided into sentence-level texts according to a preset delimiter; each character in the sentence-level text is subjected to decoupling attention processing to calculate the attention score of the current character and the context character and obtain an attention weight matrix; the context characters are weighted and summed by using the attention weight matrix to obtain a context semantic feature matrix; the context semantic feature matrix is fused with an absolute position vector of each character to generate a target semantic feature; the target semantic feature is processed by a time sequence neural network to obtain a time sequence feature;
[0029] The feature fusion module: after the target semantic feature and the time sequence feature are spliced in the feature dimension, adaptive gating weights are generated by linear transformation and activation function processing; the target semantic feature and the time sequence feature are fused by using the adaptive gating weights to obtain an intermediate feature; the intermediate feature is subjected to linear processing to obtain a fusion feature;
[0030] The label prediction and entity recognition module: the fusion feature is subjected to feature extraction to obtain the enhanced feature of each character; after the enhanced feature of each character is spliced with the enhanced feature of the context character to obtain a three-dimensional context feature, the three-dimensional context feature is mapped into a dynamic transition matrix by linear transformation, and the dynamic transition matrix is fused with a preset static transition matrix into a hybrid transition matrix by using a learnable weight;
[0031] Based on the hybrid transition matrix and the fusion feature, the sequence probability of the character position ending with a preset label is calculated by a forward algorithm, then the label sequence combination of the complete character sequence with the maximum probability is obtained by recursively calculating and backtracking the position by a Viterbi algorithm, and the label sequence combination is taken as a predicted label sequence; the predicted label sequence is analyzed to recognize an entity type;
[0032] The preset label is an entity type labeled based on a BIO rule, and the entity type is a person, an organization or a task.
[0033] Advantages
[0034] For the earthquake emergency plan text, the application separates the content attention and the position attention by using the decoupling attention mechanism, accurately captures the semantic association and position dependence, and then captures the timing characteristics by using the timing neural network; the dynamic gate weight mechanism is used to adaptively integrate the target semantic characteristics and the timing characteristics, so that the dynamic balance of the semantic characteristics and the timing characteristics is realized; the hybrid transfer matrix is used to accurately model the dependence relationship between the labels, and the recognition accuracy of the complex entity is improved. DETAILED DESCRIPTION
[0035] The following examples are intended to illustrate the present application, but not further limit the present application.
[0036] The application provides a seismic emergency plan named entity recognition method, comprising:
[0037] S1: dividing the to-be-processed seismic emergency plan text data into sentence-level texts according to a preset delimiter; each character in the sentence-level text is processed by decoupling attention, the attention score of the current character and the context character is calculated, and an attention weight matrix is obtained; the context characters are weighted and summed by using the attention weight matrix, and a context semantic feature matrix is obtained; the context semantic feature matrix is fused with an absolute position vector of each character to generate a target semantic feature; the target semantic feature is processed by a timing neural network to obtain a timing feature.
[0038] The to-be-processed seismic emergency plan text refers to original data that needs to be recognized, including complete plan documents, chapter fragments or single sentences. Since the original data often contains irrelevant content such as web advertisements, navigation links, copyright statements and the like, batch cleaning of the original data is required. For example, URL links, HTML tags and specific advertisement terms are accurately positioned and removed by pattern matching. This step effectively filters out invalid information and ensures the purity of the data content.
[0039] The sentence-level text refers to the smallest processing unit composed of multiple characters obtained by splitting the to-be-processed text.
[0040] The preset delimiter can be a Chinese sentence-ending punctuation mark “.”, which is used to split the structured sentence-level text.
[0041] Before the decoupling attention processing, each character in the sentence-level text is mapped to a word embedding vector to form a character vector sequence.
[0042] Further, each character in the sentence-level text is processed by decoupling attention, the attention score of the current character and the context character is calculated, and an attention weight matrix is obtained, specifically:
[0043] Each character in the sentence-level text is processed by decoupled attention, separating the content vector and the relative position vector of each character, calculating the content vector attention score, the relative position vector attention score and the content vector and relative position vector attention score of the current character and the context character, fusing the three types of attention scores, normalizing to obtain the attention weight matrix.
[0044] Among them, the content vector represents the semantics of the character itself, and the relative position vector represents the position relationship of the character in the sentence-level text.
[0045] Further, by formula: And Realized to further capture the semantic association between characters in the sentence-level text.
[0046] In the formula, Indicates the attention weight matrix; Indicates the position i Content vector projection; Indicates the position j Content vector projection; Indicates the position i Relative position j Vector projection relative to position Indicates the position j Relative position i Vector projection relative to position Indicates the position i And j Relative position; k Indicates the maximum relative distance threshold.
[0047] In the formula, i And j Represent the position index in the sequence, the value range is: 1-L, L represents the sequence length. i Is the target position, indicating the position currently calculating attention; j Is the source position, indicating the position of attention mechanism.
[0048] Since the earthquake emergency plan text often contains multiple nested entities and long-distance dependency relationships, the application separates the content attention and position attention by using the decoupled attention mechanism, which can accurately capture the semantic association of field terms, such as the modification relationship between “emergency” and “command center”, and can also accurately capture the position dependency, such as the order logic between “early warning” and “response”, avoiding the information confusion of traditional attention mechanism.
[0049] In addition to using relative position information, the application also fuses the context semantic feature matrix with the absolute position vector of each character, supplements the absolute position information, can more effectively model the entity context dependence across paragraphs in long text, such as the echo of "emergency supplies" and "reserve point" in the latter, and improves the robustness of entity recognition.
[0050] In addition, a small perturbation can also be applied to the word embedding vector to construct an adversarial sample, and virtual adversarial training is used to improve the robustness of the model to adversarial data.
[0051] Finally, when extracting timing features, a bidirectional long short-term memory network is used to supplement the context timing relationship for each character.
[0052] S2: After the target semantic features and timing features are spliced in the feature dimension, the adaptive gating weight is generated through linear transformation and activation function processing; the target semantic features and timing features are fused by using the adaptive gating weight to obtain intermediate features; the intermediate features are linearly processed to obtain fusion features.
[0053] The target semantic features contain the deep semantics and position information of the text, and the timing features include the timing dependence and context association information, in order to solve the efficient fusion problem of the target semantic features and timing features in the earthquake emergency plan text, preferably, the target semantic features and timing features are fused by using the adaptive gating weight to obtain intermediate features, which are realized by formula:
[0054] In the formula, , , The intermediate features, timing features and target semantic features of the i-th character are represented by i, respectively. t The adaptive gating weight generated for the i-th character is represented by i. t
[0055] The application dynamically integrates the target semantic features and timing features through a dynamic gating weight mechanism, realizes the dynamic balance of semantic features and timing features, and is especially suitable for processing long-distance dependence, nested entities and professional term recognition tasks specific to the field of earthquakes.
[0056] S3: The fusion features are extracted to obtain enhanced features of each character; after the enhanced features of each character and context characters are spliced to obtain three-dimensional context features, the three-dimensional context features are linearly transformed and mapped into a dynamic transition matrix, and the dynamic transition matrix is fused with a preset static transition matrix through a learnable weight to obtain a hybrid transition matrix.
[0057] Based on the hybrid transition matrix and fusion features, the probability of a sequence ending with a preset label is calculated position by position using the forward algorithm. Then, the Viterbi algorithm is used to recursively calculate and backtrack position by position. The label sequences of the complete character sequences with the highest probability are combined as the predicted label sequences. The predicted label sequences are then parsed to identify the entity type.
[0058] The preset tags are entity types labeled based on BIO rules, and the entity types are Person (PER), Organization (ORG), or Task (TASK).
[0059] First, the concepts involved in this invention are as follows:
[0060] A character refers to the smallest unit of sentence-level text and is the basic object for label prediction.
[0061] Tags are used to assign entity affiliation identifiers to each character. This invention is based on BIO rules and has seven tag categories: B-PER, I-PER, B-ORG, I-ORG, B-TASK, I-TASK, and O, used to mark whether a character belongs to an entity and its entity type. Among the entity types, Personnel (PER) includes volunteers, wounded, commanders, etc.; Organizations (ORG) include earthquake bureaus, governments, and military units, etc.; and Tasks (TASK) include carrying out medical rescue work, collecting and summarizing earthquake information, and reporting situations, etc.
[0062] Tag sequence: A sequence formed by arranging the tags of all characters in a sentence-level text in character order.
[0063] Entities: Information units with emergency significance parsed from the tag sequence (divided into three categories: PER, ORG, and TASK).
[0064] In the label prediction stage, for named entity recognition in earthquake emergency plans, relying solely on a pre-set static transition matrix is insufficient to handle complex entity structures, such as nested entities and long-distance dependencies. The pre-set static transition matrix captures general transition patterns between labels, such as B-ORG followed by I-ORG, while the dynamic transition matrix generates transition probabilities in real time based on the contextual features of the text, such as the modifier relationships in "earthquake emergency command center." The two are combined through learnable weights to improve the ability to recognize entities specific to the earthquake emergency domain.
[0065] The preset static transition matrix is as follows: (K is the number of preset label categories), obtained through parameter learning, representing the prior transition probability between labels. For example, the probability of B-ORG followed by I-ORG is usually high. Constraints are added, such as prohibiting transition from the end label [SEP] to other labels.
[0066] Dynamic transition matrix: (N is batch size, and L is sequence length), and the generation process is as follows:
[0067] Firstly, the fusion feature is extracted to obtain the enhanced feature of each character, specifically:
[0068] The fusion feature is sequentially subjected to linear processing, GELU activation function processing, linear processing and layer normalization to obtain the enhanced feature of each character.
[0069] Further, the preset static transition matrix is fused with the learnable weight to form a hybrid transition matrix, which is from the formula: to achieve;
[0070] In the formula, , , respectively represent the hybrid transition matrix, the preset static transition matrix and the dynamic transition matrix. The learnable weight is constrained to [0, 1] by the Sigmoid function.
[0071] According to the present application, the weight of the preset static transition matrix and the dynamic transition matrix is dynamically adjusted according to the characteristics of the fusion feature, for example, when recognizing "national earthquake disaster emergency rescue team", the dynamic transition matrix is enhanced to capture the hierarchical transition rule of the nested entity, so as to more accurately model the dependency relationship between labels and improve the recognition accuracy of complex entities.
[0072] Further, based on the hybrid transition matrix and the fusion feature, the sequence probability of the character position ending with the preset label is calculated by the forward algorithm, which is from the formula: to achieve;
[0073] In the formula, , respectively represent the sequence probability of the first K-1 characters ending with the preset label and the sequence probability of the first K-2 characters ending with the preset label; K represents the number of categories of the preset label. t v u The hybrid transition matrix is represented by the hybrid transition matrix. The emission score is obtained by linear mapping the character feature vector obtained by feature extraction of the fusion feature to the score of the character belonging to each preset label. In the label prediction stage,
[0074] and represent specific preset labels. Among them represents a specific label at position -1 (the previous character). represents a specific label at position -2 (the previous character). A specific tag for (the current character).
[0075] In one embodiment, the text is "The Provincial Earthquake Administration needs to quickly evaluate the results of earthquake disasters."
[0076] Its correct tag sequence is "[B-ORG, I-ORG, I-ORG, I-ORG, O, O, O, B-TASK, I-TASK, I-TASK, I-TASK, I-TASK, I-TASK, I-TASK, I-TASK, O]".
[0077] The BIO rule annotation result is "Province [B-ORG] Earthquake [I-ORG] Bureau [I-ORG] needs to [O] quickly [O] evaluate [B-TASK] the [I-TASK] earthquake [I-TASK] disaster [I-TASK] results [I-TASK]. [O]".
[0078] A possible incorrect predicted tag sequence is "[B-ORG, I-ORG, I-ORG, I-ORG, O, B-TASK, I-TASK, B-TASK, I-TASK, I-TASK, I-TASK, I-TASK, I-TASK, I-TASK, I-TASK, O]", where "quickly" is misidentified as an entity. Similarly, this text can be predicted with multiple tag sequences.
[0079] For one of the predicted sequence tags "[B-ORG, I-ORG, I-ORG, I-ORG, O, O, O, B-TASK, I-TASK, I-TASK, I-TASK, I-TASK, I-TASK, I-TASK, I-TASK, O]", when t = 3 (corresponding to the character "Bureau", t refers to the position of a character in a sentence, t = 0 is the first character, t = 3 is the fourth character), let v =I-ORG, indicating the situation ending with the tag I-ORG at this position. The possible tag sequences for the previous t characters (i.e., the first 4 characters) ending with I-ORG are:
[0080] 1: [B-ORG, I-ORG, I-ORG, I-ORG];
[0081] 2: [B-ORG, B-ORG, I-ORG, I-ORG] (not conforming to the BIO constraint);
[0082] 3: [O, B-ORG, I-ORG, I-ORG] (not conforming to BIO constraint);
[0083] Only the first label sequence conforms to the BIO rule, and the other two are illegal. The logarithmic sum of all these label sequences ending with I-ORG in the total path probability, i.e., the forward probability of this position .
[0084] Further, the Viterbi algorithm recursively calculates and backtracks the label sequence of the complete character sequence with the maximum probability, combines the label sequence as a predicted label sequence, and is realized by the formula: .
[0085] In the formula, , respectively represent the maximum probability of the first t characters ending with a preset label v , and the maximum probability of the first t -1 characters ending with a preset label u ; K represents the number of categories of preset labels; represents a mixed transition matrix; represents an emission score.
[0086] In this way, among all possible label sequence combinations, the probability of the sequence with the maximum probability of the entire label sequence is obtained through the recursion and backtracking of the Viterbi algorithm, and the sequence is the predicted label sequence.
[0087] In one embodiment, the predicted label sequence obtained by backtracking is "[B-ORG, I-ORG, I-ORG, I-ORG, O, O, O, B-TASK, I-TASK, I-TASK, I-TASK, I-TASK, I-TASK, I-TASK, I-TASK, O]", which, combined with the BIO rule, parses three types of emergency entities, i.e., personnel (PER), organization (ORG), or task (TASK), to complete the entity recognition of the text to be processed.
[0088] For earthquake emergency plan texts, the present application separates content attention and position attention by using a decoupling attention mechanism, accurately captures semantic association and position dependence, and then uses a time sequence neural network to capture time sequence features; then, through a dynamic gate weight mechanism, the target semantic features and time sequence features are adaptively integrated, realizing dynamic balance of the semantic features and the time sequence features; a mixed transition matrix is used to accurately model the dependency relationship between labels, improving the recognition accuracy of complex entities.
[0089] The present application also provides a naming entity recognition system for earthquake emergency plans, comprising:
[0090] The feature extraction module: the to-be-processed earthquake emergency plan text data is divided into sentence-level texts according to a preset delimiter; each character in the sentence-level text is processed by decoupled attention, the attention score of the current character and the context character is calculated, and an attention weight matrix is obtained; the context characters are weighted and summed by using the attention weight matrix, and a context semantic feature matrix is obtained; the context semantic feature matrix is fused with the absolute position vector of each character to generate a target semantic feature; the target semantic feature is processed by a time sequence neural network to obtain a time sequence feature;
[0091] The feature fusion module: after the target semantic feature and the time sequence feature are spliced in the feature dimension, adaptive gating weights are generated by linear transformation and activation function processing; the target semantic feature and the time sequence feature are fused by using the adaptive gating weights to obtain an intermediate feature; the intermediate feature is processed by linear processing to obtain a fusion feature;
[0092] The label prediction and entity recognition module: the fusion feature is extracted to obtain the enhanced feature of each character; after the three-dimensional context feature of each character is obtained by splicing the enhanced feature of itself and the context characters, the three-dimensional context feature is mapped into a dynamic transition matrix by linear transformation; and the dynamic transition matrix and a preset static transition matrix are fused into a hybrid transition matrix by a learnable weight;
[0093] Based on the hybrid transition matrix and the fusion feature, the sequence probability of each position ending with a preset label is calculated by a forward algorithm, then the sequence probability is recursively calculated by a Viterbi algorithm, and the label sequence of the complete character sequence with the maximum probability is combined as a predicted label sequence by backtracking; the predicted label sequence is analyzed to identify the entity type;
[0094] The preset label is an entity type labeled based on the BIO rule, and the entity type is a person, an organization or a task.
[0095] Experiment and result analysis
[0096] The present application compares the performance and advantages of the model using the method of the present application by designing comparative experiments and ablation experiments, and comprehensively evaluates the performance and advantages of the model using the method of the present application compared with other models.
[0097] 1. Experimental setup
[0098] The present application is developed based on Python 3.8 and Pytorch 2.0 deep learning framework, and the running environment is Windows 10 operating system, which is configured with CUDA 11.8 and RTX 3090 graphics card. The neural network hyperparameters are set as shown in Table 1.
[0099] Table 1 Hyperparameter settings
[0100]
[0101] The data mainly comes from two aspects: one is the official specification documents such as "National Earthquake Emergency Plan" and "Earthquake Emergency Response Work Rules" and the emergency plan texts published by local earthquake bureaus; the other is the official website of the emergency management department and professional platforms such as the earthquake network. In data preprocessing, the original data is cleaned by regular expression, and irrelevant texts such as advertisements, invalid links and other irrelevant texts are removed, and the contents of emergency response, command and coordination are mainly retained. The effective data is stored as TXT text in UTF-8 encoding. In text structured processing, the sentence is divided by the "." punctuation mark. Finally, 2167 pieces of artificial annotation corpus are sorted, with a total of more than 110,000 characters, containing 9058 entities of 3 types of personnel, organization and task.
[0102] Considering that the model is small sample learning, the above corpus is divided into training set, validation set and test set according to the ratio of 7:1.5:1.5, and the number distribution of each type of entity is shown in Table 2.
[0103] Table 2 Number distribution of each entity
[0104]
[0105] 2、Evaluation index
[0106] The precision (P), recall (R) and F1 value (F-score) commonly used in the task of named entity recognition are used as the model performance evaluation index. The calculation of each index is as follows.
[0107] ;
[0108] ;
[0109] ;
[0110] Among them, TP (True Positive, True Positive) represents the number of samples that are actually positive and correctly predicted by the model as positive; FP (False Positive, False Positive) represents the number of samples that are actually negative but incorrectly predicted by the model as positive; FN (False Negative, False Negative) represents the number of samples that are actually positive but incorrectly predicted by the model as negative.
[0111] 3、Comparison experiment
[0112] To comprehensively verify the performance advantages of the identification method of the present application corresponding to the model DeBERTa-BiLSTM-AGFM-HybridCRF, BiLSTM-CRF, BERT-CRF, BERT-BiLSTM-CRF, BERT-BiGRU-CRF, DeBERTa-BiLSTM-CRF are also selected as comparative models, and experiments are carried out on the self-built earthquake emergency plan naming entity corpus.
[0113] Among them, compared with the present application, BiLSTM-CRF does not undergo decoupling attention processing, dynamic gate weight processing and hybrid transition matrix processing; BERT-CRF does not undergo decoupling attention processing, bidirectional recurrent network processing, dynamic gate weight processing and hybrid transition matrix processing; BERT-BiLSTM-CRF does not undergo decoupling attention processing, dynamic gate weight processing and hybrid transition matrix processing; BERT-BiGRU-CRF does not undergo decoupling attention processing, dynamic gate weight processing and hybrid transition matrix processing; DeBERTa-BiLSTM-CRF does not undergo dynamic gate weight processing and hybrid transition matrix processing.
[0114] In order to ensure the rigor of the experiment, all models uniformly adopt BIO annotation system and the same hyperparameter optimization strategy. The overall entity experimental results are shown in Table 3, and the entity experimental results of each type are shown in Table 4.
[0115] Table 3 Overall comparative experimental results
[0116]
[0117] As can be seen from Table 3, the method proposed in the application corresponds to the DeBERTa-BiLSTM-AGFM-HybridCRF model, which performs best in the overall entity recognition task, and the F1 value reaches 95.23%. Compared with the BERT-CRF model, the precision, recall and F1 value of the model of the application are increased by 11.71%, 7.32% and 9.62% respectively, which shows that after adopting the decoupling attention processing, the model has stronger ability to distinguish and model the context semantics; the dynamic gate weight processing realizes the adaptive fusion of multi-layer semantic features, and improves the discriminability of feature expression; the hybrid transfer matrix processing optimizes the global consistency of sequence labeling by fusing static and dynamic label transfer relationships. In addition, compared with the BERT-BiLSTM-CRF and BERT-BiGRU-CRF models, the F1 value of the model of the application is increased by 1.73% and 2.46% respectively, which further verifies the significant effect of the dynamic gate weight processing and the hybrid transfer matrix processing in feature fusion and label prediction optimization. In summary, the model of the application introduces decoupling attention processing, dynamic gate weight processing and hybrid transfer matrix processing, which significantly improves the overall performance of entity recognition, and proves the effectiveness and superiority of the model in processing complex text entity recognition tasks.
[0118] Table 4 Comparison of experimental results of different entities
[0119]
[0120] Table 4 compares the performance of different models on PER, ORG and TASK three specific entity categories. For the personnel entity, the F1 value of the model of the application is increased by 12.44% compared with the baseline model BiLSTM-CRF, which shows that the recognition of low-frequency entities has been greatly improved; for the organization entity, which has complex semantic structure and nested and modification relationship, the F1 of DeBERTa-BiLSTM-CRF is increased by 1.28% compared with BERT-BiLSTM-CRF. DeBERTa-BiLSTM-AGFM-HybridCRF further amplifies the advantage, and the F1 value is increased by 1.57%. For the task entity, the DeBERTa-BiLSTM-AGFM-HybridCRF model surpasses other models in precision, recall and F1 index.
[0121] 4. Ablation experiment
[0122] To verify the effectiveness of each processing of the model, two groups of ablation experiments are designed compared with the model of the application: DeBERTa-BiLSTM-AGFM-CRF model without dynamic transition matrix processing, but only using traditional static transition matrix processing, and DeBERTa-BiLSTM-HybridCRF model without dynamic gating weight processing, but directly inputting the output features of the bidirectional long short-term memory network into the hybrid decoding layer for hybrid transition matrix processing, and all ablation models are evaluated on the same training set, validation set and test set using the same hyperparameter configuration as the complete model. The overall entity experiment results are shown in Table 5, and the entity experiment results of each type are shown in Table 6.
[0123] Table 5 Overall ablation experiment results
[0124]
[0125] The ablation experiment results of Table 5 show that compared with the DeBERTa-BiLSTM-HybridCRF model, the DeBERTa-BiLSTM-AGFM-HybridCRF model of the application with dynamic gating weight processing improves the F1 value by 0.64%. This indicates that the dynamic gating weight processing can more accurately locate the entity and reduce misjudgment through multi-granularity feature fusion. Compared with the DeBERTa-BiLSTM-AGFM-CRF model using traditional static transition matrix processing, the DeBERTa-BiLSTM-AGFM-HybridCRF model of the application improves the precision, recall and F1 value by 0.16%, 0.43% and 0.29% respectively. This reflects the advantage of hybrid transition matrix processing in processing complex label sequences, optimizes the recognition of entity boundaries and improves the overall performance of the model.
[0126] Table 6 Ablation experiment results of each type of entity
[0127]
[0128] The ablation experiment results of Table 6 show that the dynamic gating weight processing and the hybrid transition matrix processing play a key role in various entity recognition tasks. After using the model of the present application to perform dynamic gating weight processing, the F1 values of the PER, ORG and TASK categories are increased by 0.83%, 0.03% and 0.93% respectively compared with the DeBERTa-BiLSTM-HybridCRF model without using dynamic gating weight processing. This shows that the dynamic gating weight processing can effectively enhance the model's ability to extract multi-granularity features of entities. Compared with only using the traditional static transition matrix processing, the hybrid transition matrix processing using the model of the present application also has some improvement in the three entity categories. This shows that the hybrid transition matrix processing performs well in optimizing label sequence prediction and improving the accuracy of entity boundary recognition.
Claims
1.A method for identifying named entities in earthquake emergency plans, characterized in that, The method comprises the following steps: S1: dividing the to-be-processed earthquake emergency plan text data into sentence-level texts according to a preset delimiter; Each character in the sentence-level texts is processed by decoupled attention to calculate the attention score of the current character and the context character, and an attention weight matrix is obtained; The context semantic feature matrix is obtained by weighted summation of the context characters using the attention weight matrix; the context The target semantic feature is fused with the absolute position vector of each character to generate a target semantic feature; The target semantic feature is processed by a time sequence neural network to obtain a time sequence feature; S2: after the target semantic feature and the time sequence feature are spliced in the feature dimension, adaptive gating weights are generated by linear transformation and activation function processing; the target semantic feature and the time sequence feature are fused by using the adaptive gating weights to obtain an intermediate feature; The intermediate feature is processed by linear processing to obtain a fusion feature; S3: the fusion feature is extracted to obtain the enhanced feature of each character; after the enhanced feature of each character is spliced with the enhanced feature of the context character to obtain a three-dimensional context feature, the three-dimensional context feature is mapped to a dynamic transition matrix by linear transformation; the dynamic transition matrix is fused with a preset static transition matrix by a learnable weight to obtain a hybrid transition matrix; Based on the hybrid transition matrix and the fusion feature, the sequence probability of the character position ending with a preset label is calculated by a forward algorithm; then, the sequence probability is recursively calculated by a Viterbi algorithm, and the label sequence of the complete character sequence with the maximum probability is combined as a predicted label sequence; the predicted label sequence is parsed to identify an entity type. The preset label is an entity type labeled based on the BIO rule, and the entity type is a person, an organization or a task. 2.The earthquake emergency plan named entity recognition method of claim 1, wherein, S2 said using adaptive gating weight fusion target semantic features and timing characteristics, get intermediate features, by formula: To achieve; In the formula, , , respectively represent the middle feature, the timing feature, and the target semantic feature of the first t character; represent the adaptive gating weight generated for the first t character. 3.The earthquake emergency plan named entity recognition method of claim 1, wherein, S3 said with the preset static transfer matrix through the learnable weight fusion is a hybrid transfer matrix, by formula: To achieve; In the formula, , , respectively represent a mixed transfer matrix, a preset static transfer matrix, and a dynamic transfer matrix; represent a learnable weight constrained to [0, 1] by a Sigmoid function. 4.The earthquake emergency plan named entity recognition method of claim 1, wherein, In S1, each character in the sentence-level texts is processed by decoupled attention to calculate the attention score of the current character and the context character, and an attention weight matrix is obtained, specifically as follows: In S1, each character in the sentence-level texts is processed by decoupled attention to separate the content vector and the relative position vector of each character, calculate the content vector attention score and the relative position vector attention score of the current character and the context character, and fuse the three types of attention scores to obtain an attention weight matrix after normalization processing. 5.The earthquake emergency plan named entity recognition method of claim 4, wherein, By the formulas: and are achieved; wherein denotes an attention weight matrix; denotes a position i content vector projection; denotes a position j content vector projection; denotes a position i relative position vector projection with respect to a position j ; denotes a position j relative position vector projection with respect to a position i ; denotes a position i and j relative position; k denotes a maximum relative distance threshold. 6.The earthquake emergency plan named entity recognition method of claim 1, wherein, S3 said based on hybrid transfer matrix and fusion features, by forward algorithm to calculate the character position sequence probability end with pre-set label position by position, for by formula: To achieve; In the formula, , They represent the preceding t Each character is used in the preset label. v End sequence probability, preceding t -1 character for preset tag u The probability of the ending sequence; K represents the number of categories of the preset label; Represents the mixed transition matrix; This indicates the number of launches. 7.The earthquake emergency plan named entity recognition method of claim 1, wherein, S3 said Viterbi algorithm position recursive calculation and backtracking, with the largest probability of complete character sequence of label sequence combination, as a prediction label sequence, by formula: is implemented; In the formula, , respectively represent the maximum probability of the first t character ending with a preset label v , and the maximum probability of the first t -1 characters ending with a preset label u ; K represents the number of categories of the preset labels; represents a mixed transition matrix; represents an emission score. 8.The earthquake emergency plan named entity recognition method of claim 1, wherein, In S3, the fusion feature is extracted to obtain the enhanced feature of each character, specifically as follows: The fusion feature is sequentially processed by linear processing, GELU activation function processing, linear processing and layer normalization to obtain the enhanced feature of each character. 9.A system for earthquake emergency plan named entity recognition, characterized in that, The method comprises the following steps: A feature extraction module: dividing the to-be-processed earthquake emergency plan text data into sentence-level texts according to a preset delimiter; Each character in the sentence-level texts is processed by decoupled attention to calculate the attention score of the current character and the context character, and an attention weight matrix is obtained; The context semantic feature matrix is obtained by weighted summation of the context characters using the attention weight matrix; the context The target semantic feature is fused with the absolute position vector of each character to generate a target semantic feature; The target semantic feature is processed by a time sequence neural network to obtain a time sequence feature; A feature fusion module: after the target semantic feature and the time sequence feature are spliced in the feature dimension, adaptive gating weights are generated by linear transformation and activation function processing; the target semantic feature and the time sequence feature are fused by using the adaptive gating weights to obtain an intermediate feature; The intermediate feature is linearly processed to obtain a fused feature; The label prediction and entity recognition module: the fused feature is extracted to obtain enhanced features of each character; after the enhanced features of each character and context characters are spliced to obtain three-dimensional context features, the three-dimensional context features are linearly transformed to be mapped into a dynamic transition matrix, which is fused with a preset static transition matrix through a learnable weight to be a hybrid transition matrix; Based on the hybrid transition matrix and the fused feature, the sequence probability of each position ending with a preset label is calculated through a forward algorithm, and then the sequence probability of each position is recursively calculated and backtracked through a Viterbi algorithm, and the label sequence of the complete character sequence with the maximum probability is combined as a predicted label sequence; the predicted label sequence is parsed to recognize an entity type; The preset label is an entity type labeled based on a BIO rule, and the entity type is a person, an organization, or a task.
Citation Information
Patent Citations
Method for intelligent construction of place name annotated corpus based on interactive and iterative learning
AU2020103654A4
Natural disaster named entity identification method and device
CN116484863A