A method and system for named entity recognition of sudden events
By using dynamic sliding windows and multi-head attention processing, combined with dynamic frequency rotation position encoding, the problems of blurred entity boundaries and uneven distribution in emergency event texts are solved, achieving high-accuracy named entity recognition for emergency event texts.
Patent Information
- Application Number
- CN202511767653.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-28
- Publication Date
- 2026-01-30
- Estimated Expiration
- 2045-11-28
AI Technical Summary
Existing named entity recognition models lack dedicated models for the emergency domain when processing texts related to emergencies. The scale of labeled data is insufficient, and the semantic associations of emergency elements are not fully utilized, resulting in limited recognition accuracy, uneven entity distribution, and blurred boundaries.
A dynamic sliding window mechanism is used to segment text sequences. Combined with multi-head attention and feature enhancement processing, entity boundaries are marked through dynamic frequency rotation position encoding and entity category matching score calculation, which improves the ability to learn complex semantic patterns.
It significantly improves the accuracy of identifying key entities in emergency event texts, solves the problems of blurred entity boundaries and difficulty in identifying nested entities, and enhances the ability to learn complex semantic patterns.
Smart Images

Figure SMS_67 
Figure SMS_95 
Figure QLYQS_7
Abstract
Description
Technical Field
[0001] This invention belongs to the field of named entity recognition technology, specifically a method and system for named entity recognition of sudden events. Background Technology
[0002] With the continuous deepening of the emergency management system, emergencies have become a key factor testing society's emergency response capabilities. In recent years, various emergencies have threatened human life and property safety and hindered the advancement of social and economic development. Therefore, the efficient identification of critical information is crucial for crisis management.
[0003] With the acceleration of digital transformation, technologies such as the Internet of Things and big data are being integrated into emergency management. Natural language processing (NLP) technology, with text mining at its core, provides a new approach to emergency management, allowing for the rapid acquisition of key information about emergencies by mining disaster reports. Named entity recognition (NAME), as a fundamental step in text mining, determines the quality of information extraction based on its accuracy. Precise NAME recognition helps managers quickly pinpoint key elements in emergencies, enabling precise handling of such events.
[0004] Due to the dense use of technical terms and complex semantic structures in emergency texts, named entity recognition faces the following challenges: Currently, there is a lack of dedicated named entity recognition models for emergency domain knowledge, and the limited scale of publicly available labeled data results in insufficient labeled instances for training models, making it difficult to support the training of complex models; existing deep learning-based models do not fully utilize the semantic relationships between emergency elements (such as the dependency relationship between time, location, and trigger words) when processing emergency texts, leading to the loss of key entity features; the distribution of entities in emergency texts is significantly unbalanced (e.g., a high proportion of disaster-related entities and a small number of rare event entities), and entity boundaries are significantly affected by context (e.g., the ambiguity between the boundaries of "epicentral distance" and "focal depth"), limiting recognition accuracy. Summary of the Invention
[0005] The purpose of this invention is to provide a method and system for named entity recognition of sudden events.
[0006] A named entity recognition method for sudden events includes the following operations:
[0007] S1. Obtain the original text sequence and label each character in the original text sequence; segment the original text sequence using a dynamic sliding window mechanism, remove invalid text, and obtain the processed text sequence.
[0008] S2. The processed text sequence is converted into a token sequence. Some characters in the token sequence are masked to obtain an updated token sequence. The updated token sequence is converted into multiple embedding representations through embedding processing. The multiple embedding representations form an embedding sequence. The embedding sequence is subjected to several context feature extractions to obtain a semantic vector sequence. Each context feature extraction includes multi-head attention processing and feedforward fully connected processing.
[0009] S3. The semantic vector sequence undergoes several feature enhancement processes to obtain an enhanced semantic vector sequence. Each feature enhancement process includes multi-head attention processing, residual connection, normalization, and feedforward fully connected processing.
[0010] S4. The enhanced semantic vector sequence is projected onto a query key pair space through a linear transformation. The query key pair is segmented into a query vector and a key vector. Dynamic frequency rotation position encoding is performed on the query vector and key vector respectively to obtain the transformed query vector and key vector, which correspond to the start vector and end vector of each entity category at each position. For each entity category, several start positions and end positions are set. Several start positions and end positions are combined to obtain several start-end position pairs. Based on the transformed query vector and key vector, the matching score of the text fragments corresponding to all start-end position pairs belongs to a certain entity category is calculated. All matching scores are processed by an activation function. According to a preset threshold, start-end position pairs with scores higher than the preset threshold are selected and marked as the entity boundaries of the corresponding entity categories.
[0011] The dynamic sliding window mechanism in S1 operates as follows: the dynamic sliding window slides at a preset length with a certain step size to detect entities within the window. When the end position of the detected entity is outside the end position of the current window, the dynamic sliding window is expanded until it contains the complete entity, and intelligent truncation is achieved based on punctuation marks. The above operation is repeated until the entire original text sequence is covered.
[0012] The specific operation of expanding a dynamic sliding window is: the ending position of the expanded k-th dynamic sliding window. The length is determined by the maximum length constraint, entity boundary constraints, and punctuation marks, as shown in the following formula:
[0013] ,
[0014] ,
[0015] in, This is the initial end position of the window. The starting position of the window, and the maximum length constraint. =50, Indicates the end position of the entity. This represents the set of entities in the current window. For entity boundary constraints, This is the set of positions of all punctuation marks in the original text sequence. for The position of a punctuation mark in the text.
[0016] The multi-head attention processing in S2 is as follows: the embedded sequence generates a query matrix, a key matrix, and a value matrix through a linear mapping. The query matrix, key matrix, and value matrix are each divided into h sub-matrices, corresponding to h attention heads. Each attention head independently calculates a weighted sum. The weighted sums of the h attention heads are concatenated to obtain a weighted sum sequence. A linear transformation is performed on the weighted sum sequence to obtain the multi-head attention output.
[0017] S2 predicts the masked words based on contextual information, for the first... Words in each position that are masked Predict its probability distribution The specific formula is as follows:
[0018] ,
[0019] ,
[0020] in, It is a semantic vector sequence. It is a learnable projection matrix. Semantic vector sequence The semantic vector corresponding to the masked position m. This is a bias term.
[0021] The specific formula for calculating the weighted sum is as follows:
[0022] ,
[0023] in, For activation function, , , These are the i-th submatrices after partitioning the query matrix Q, key matrix K, and value matrix V, respectively. yes The transpose of the matrix, This is the scaling factor.
[0024] The specific steps for calculating the matching score in S4 are as follows: For each entity category... and each pair of positions Calculate the match score for this category:
[0025] ,
[0026] Among them, inner product Measure the first The token serves as the starting point of the entity and the first... The degree of semantic association between each token as an entity endpoint. This is the scaling factor.
[0027] The specific operation of dynamic frequency rotation position encoding in S4 is as follows: for each starting position... query vector and finish line key vector Dynamic frequency rotation position encoding is performed on each vector to obtain the encoded query vector. and key vector The specific formula is as follows:
[0028] ,
[0029] ,
[0030] in, The base frequency parameter; m represents the query vector. The index, n represents the key vector. The index; and Starting position and finish line The dynamic frequency adjustment factor, Represents the query vector The component in the 2t-th dimension; Represents the query vector The component in the (2t+1)th dimension; Represents the key vector The component in the 2t-th dimension; Represents the key vector The component in the 2t+1th dimension.
[0031] The embedding process in S2 specifically involves: for each position in the text sequence... Embedded representation It consists of lexical embedding, positional embedding, and segmented embedding, with the specific formula as follows:
[0032] ,
[0033] in, For word embedding, For location embedding, This is for segmented embedding.
[0034] A named entity recognition system for sudden events, characterized in that it includes:
[0035] Text preprocessing module: Obtains the original text sequence, labels each character in the original text sequence; segments the original text sequence using a dynamic sliding window mechanism, removes invalid text, and obtains the processed text sequence;
[0036] Context feature extraction module: The processed text sequence is converted into a token sequence. Some characters in the token sequence are masked to obtain an updated token sequence. The updated token sequence is converted into multiple embedding representations through embedding processing. The multiple embedding representations form an embedding sequence. The embedding sequence undergoes several context feature extractions to obtain a semantic vector sequence. Each context feature extraction includes multi-head attention processing and feedforward fully connected processing.
[0037] Feature enhancement processing module: The semantic vector sequence undergoes several feature enhancement processes to obtain an enhanced semantic vector sequence. Each feature enhancement process includes multi-head attention processing, residual connection, normalization, and feedforward fully connected processing.
[0038] Entity recognition module: The enhanced semantic vector sequence is projected onto a query key pair space through a linear transformation. The query key pair is segmented into a query vector and a key vector. Dynamic frequency rotation position encoding is performed on the query vector and key vector respectively to obtain the transformed query vector and key vector, which correspond to the start vector and end vector of each entity category at each position. For each entity category, several start positions and end positions are set. These start and end positions are combined to obtain several start-end position pairs. Based on the transformed query vector and key vector, the matching score of the text fragments corresponding to all start-end position pairs is calculated to indicate that they belong to a certain entity category. All matching scores are processed by an activation function. Based on a preset threshold, start-end position pairs with scores higher than the preset threshold are selected and marked as the entity boundaries of the corresponding entity category.
[0039] The beneficial effects of this invention are:
[0040] This invention proposes a named entity recognition method for sudden events. First, the original text sequence is acquired and segmented and embedded to obtain an embedded sequence. Then, a semantic vector sequence is obtained through multiple contextual feature extractions. Subsequently, an enhanced semantic vector sequence is obtained through several feature enhancement processes. Finally, the enhanced semantic vector sequence is projected onto a query key pair space, segmented into query vectors and key vectors, and then marked with entity boundaries corresponding to entity categories through dynamic frequency rotation position encoding, entity category matching score calculation, activation function processing, and threshold filtering. This invention effectively improves the ability to learn complex semantic patterns in event texts, solves the problems of ambiguous entity boundaries and difficulties in recognizing nested entities, and significantly improves the recognition accuracy of key entities (such as time, location, and event subjects) in events. Detailed Implementation
[0041] This embodiment provides a named entity recognition method for sudden events, including the following operations:
[0042] S1. Obtain the original text sequence and label each character in the original text sequence; segment the original text sequence using a dynamic sliding window mechanism, remove invalid text, and obtain the processed text sequence.
[0043] This invention selects the publicly available Chinese Emergencies Corpus (CEC) as the original text sequence. The CEC corpus collects news reports of four types of events (earthquake, fire, traffic accident, and food poisoning) as corpus according to the classification system of the National Emergency Response Plan for Public Emergencies, totaling 348 articles.
[0044] The BIO sequence labeling scheme is used to label each character of the original text sequence. Here, B (Begin) represents the start of an entity, I (Inside) represents the middle or end of an entity, and O (Outside) represents a non-entity character. Based on these entity category definitions, B-Label represents the first character of a Chinese event entity, I-Label represents the middle or end of a Chinese event entity, and O represents other non-entity characters.
[0045] Taking the text sequence "As of 8:00 AM on September 3, a 6.1 magnitude earthquake occurred at the border of Renhe District, Panzhihua City, Sichuan Province and Huili County, Liangshan Prefecture, Sichuan Province" as an example, the annotation results are shown in Table 1. This includes three entities of three types: "Time" representing the time "as of 8:00 AM on September 3," "Location" representing the location "the border of Renhe District, Panzhihua City, Sichuan Province and Huili County, Liangshan Prefecture, Sichuan Province," and "Denoter" representing the trigger word "earthquake." The annotation tool used was the open-source text annotation platform docano, and the Chinese event entity recognition corpus was obtained through manual annotation.
[0046] Table 1 Examples of Event Text Anticipation Annotations
[0047]
[0048] To address the issues of excessive text length and limited sample size in the original text sequence, a dynamic sliding window mechanism is used to segment the original text sequence. The dynamic sliding window is set to a length of 50 characters and slides in a certain step to detect entities within the window. When the end position of the detected entity is outside the end position of the current window, the dynamic sliding window is expanded until the complete entity is included. Intelligent truncation is achieved based on punctuation marks. The above operation is repeated until the entire original text sequence is covered.
[0049] Given the original text sequence and entity set The k-th dynamic sliding window The entity integrity constraint shown in the following equation must be satisfied:
[0050]
[0051] This constraint ensures that any entity intersecting the dynamic sliding window... It must be completely contained within the current window to prevent entity fragmentation.
[0052] The ending position after the expansion of the kth dynamic sliding window The length is determined by the maximum length constraint, entity integrity constraint, and punctuation marks, and the specific formula is as follows:
[0053] ,
[0054] ,
[0055] in, This is the initial end position of the window. The starting position of the window, and the maximum length constraint. =50, Indicates the end position of the entity. This represents the set of entities in the current window. For entity boundary constraints, This is the set of positions of all punctuation marks in the original text sequence. for The position of a punctuation mark in the text.
[0056] To mitigate the risk of entity fragmentation, a 128-character overlap region is established between fragments, and a semantic filtering mechanism is used to remove invalid text without entity annotations. After determining the boundaries of the dynamic sliding window, entity labels are converted from global coordinates to relative coordinates within the fragment.
[0057] ,
[0058] ,
[0059] in, and These represent the start and end positions (global coordinates) of the entity in the original text sequence, respectively, and offset is the starting offset of the current segment. and These are the start and end positions (relative coordinates) within the transformed segment. This transformation process is crucial for subsequent model training, ensuring that the positional information of entity labels within their respective segments remains accurate regardless of how the text is segmented.
[0060] The sliding process of a dynamic sliding window is achieved through the following formula:
[0061] ,
[0062] in, and These represent the starting positions of the current window and the next window, respectively, and the overlap length. This design ensures that key contextual information is preserved between adjacent segments. It effectively reduces the risk of entities being incorrectly segmented at segment boundaries; and ensures that key entities appear completely in adjacent segments even when located at window edges, providing the model with richer contextual learning signals.
[0063] The final dataset contains a total of 2484 entries, and the label statistics are shown in Table 2.
[0064] Table 2 Training Data Label Statistics
[0065]
[0066] S2. The processed text sequence is converted into a token sequence. Some characters in the token sequence are masked to obtain an updated token sequence. The updated token sequence is converted into multiple embedding representations through embedding processing. The multiple embedding representations form an embedding sequence. The embedding sequence is subjected to several context feature extractions to obtain a semantic vector sequence. Each context feature extraction includes multi-head attention processing and feedforward fully connected processing.
[0067] The embedding process specifically involves: for each position in the text sequence... Embedded representation It consists of lexical embedding, positional embedding, and segmented embedding, with the specific formula as follows:
[0068] ,
[0069] in, For word embedding, For location embedding, This is segmented embedding. Multiple embeddings constitute an embedding sequence. .
[0070] The embedded sequence generates a query matrix, a key matrix, and a value matrix through linear mapping. The query matrix, key matrix, and value matrix are each divided into h sub-matrices, corresponding to h attention heads. Each attention head independently calculates a weighted sum, and the weighted sums of the h attention heads are concatenated to obtain a weighted sum sequence. A linear transformation is performed on the weighted sum sequence to obtain the multi-head attention output.
[0071] In multi-head self-attention processing, for a given input sequence (in ), which are then projected onto the query matrix, key matrix, and value matrix respectively using linear mapping. For the , The specific formula for each attention point is as follows:
[0072] ,
[0073] in, , and This is the first A trainable projection matrix specifically defined for each attention head. For sequence length, To hide the dimension.
[0074] The i-th attention head The specific formula for calculating the weighted sum is as follows:
[0075] ,
[0076] in, For activation function, , , These are the i-th submatrices after partitioning the query matrix Q, key matrix K, and value matrix V, respectively. yes The transpose of the matrix, This is the scaling factor.
[0077] h attention heads The weighted sums are concatenated to obtain a weighted sum sequence; a linear transformation is then performed on the weighted sum sequence to obtain the multi-head attention output. The specific formula is as follows:
[0078] ,
[0079] in, It is a learnable weight matrix.
[0080] The feedforward fully connected processing first normalizes the output through a fully connected process. The original dimension Upgrade to Dimension Then, the GELU activation function is applied, and finally, the dimension is reduced through another fully connected layer. Compress back to original dimensions The specific calculation formula is as follows:
[0081] ,
[0082] in For activation function, , , , This is the weight matrix. , This is a bias term.
[0083] By masking a portion of the characters in the token sequence and employing whole-word masking technology, the Chinese text is segmented and all characters of the entire word are masked simultaneously, preserving word-level contextual information and thus better capturing Chinese semantic features.
[0084] S2 is model-based. During the pre-training phase, the model predicts the probability distribution of masked words in the input text sequence, and optimizes the model parameters based on the probability distribution. S2 predicts the masked words based on contextual information. Words in each position that are masked Predict its probability distribution The specific formula is as follows:
[0085] ,
[0086] ,
[0087] in, It is a semantic vector sequence. It is a learnable projection matrix. Semantic vector sequence The semantic vector corresponding to the masked position m. This is the bias term. Through pre-training, the model can learn rich semantic representations and contextual understanding capabilities.
[0088] S3. The semantic vector sequence undergoes several feature enhancement processes to obtain an enhanced semantic vector sequence. Each feature enhancement process includes multi-head attention processing, residual connection, normalization, and feedforward fully connected processing.
[0089] In named entity recognition tasks using Chinese event corpora (such as disaster event texts like cold waves, earthquakes, and mudslides), the texts often contain a large number of specialized terms and complex sentence structures, making it difficult for contextual feature extraction to fully capture the long-distance dependencies and fine-grained semantics implicit in the event context. Therefore, this invention introduces feature enhancement processing based on the output of contextual feature extraction to enhance the in-depth mining and accurate capture of contextual information in the event domain.
[0090] Each multi-head attention and feedforward fully connected processing step is coupled with residual connections and layer normalization to preserve the original feature information. The specific formula is as follows:
[0091] ,
[0092] ,
[0093] in, For layer normalization function, Indicates the first Layer input, For multi-head attention output, This represents the output of the previous sub-layer. To enhance the semantic vector sequence.
[0094] S4. The enhanced semantic vector sequence is projected onto a query key pair space through a linear transformation. The query key pair is segmented into a query vector and a key vector. Dynamic frequency rotation position encoding is performed on the query vector and key vector respectively to obtain the transformed query vector and key vector, which correspond to the start vector and end vector of each entity category at each position. For each entity category, several start positions and end positions are set. Several start positions and end positions are combined to obtain several start-end position pairs. Based on the transformed query vector and key vector, the matching score of the text fragments corresponding to all start-end position pairs belongs to a certain entity category is calculated. All matching scores are processed by an activation function. According to a preset threshold, start-end position pairs with scores higher than the preset threshold are selected and marked as the entity boundaries of the corresponding entity categories.
[0095] The enhanced semantic vector sequence is projected onto a query key pair space through a linear transformation. Let the enhanced semantic vector sequence be... ,in For the number of tokens, To hide the dimension, the specific formula for the linear transformation is as follows:
[0096] ,
[0097] in It is the number of entity categories. It is the internal dimension of each type of entity. For query key pairs, split them into query vectors. and key vector These correspond to the start vector and end vector of each entity category at each location, respectively.
[0098] To explicitly perceive the relative position of the token in the text sequence, for each starting position... query vector and finish line key vector Dynamic Frequency RoPE (DF-RoPE) is performed on each vector to obtain the encoded query vector. and key vector The specific formula is as follows:
[0099] ,
[0100] ,
[0101] in, The base frequency parameter; m represents the query vector. The index, n represents the key vector. The index; and Starting position and finish line The dynamic frequency adjustment factor, Represents the query vector The component in the 2t-th dimension; Represents the query vector The component in the (2t+1)th dimension; Represents the key vector The component in the 2t-th dimension; Represents the key vector The component in the 2t+1th dimension.
[0102] Dynamic frequency adjustment factor and They are defined as follows:
[0103] ,
[0104] ,
[0105] in, and The tanh function is used to ensure that the adjustment process is smooth and bounded. The intensity parameter is learnable and adaptively optimized during training. This is the maximum sequence length, used for position normalization.
[0106] Encoded query vector and key vector This method retains the original semantic information while incorporating relative positional information. In subsequent inner product calculations, this rotational position encoding allows the model to automatically perceive the changes. and The distance relationship between them can be used to more accurately determine whether entities with long spans and complex structures (such as the "Yingxiu Town Primary School Teaching Building in Wenchuan County") constitute a whole.
[0107] The specific steps for calculating the matching score are as follows: for each entity category and each pair of positions Calculate the match score for this category:
[0108] ,
[0109] Among them, inner product Measure the first The token serves as the starting point of the entity and the first... The degree of semantic association between each token as an entity endpoint. This is a scaling factor to avoid extreme fluctuations in calculation results in high-dimensional spaces.
[0110] This embodiment also provides a named entity recognition system for sudden events, including:
[0111] Text preprocessing module: Obtains the original text sequence, labels each character in the original text sequence; segments the original text sequence using a dynamic sliding window mechanism, removes invalid text, and obtains the processed text sequence;
[0112] Context feature extraction module: The processed text sequence is converted into a token sequence. Some characters in the token sequence are masked to obtain an updated token sequence. The updated token sequence is converted into multiple embedding representations through embedding processing. The multiple embedding representations form an embedding sequence. The embedding sequence undergoes several context feature extractions to obtain a semantic vector sequence. Each context feature extraction includes multi-head attention processing and feedforward fully connected processing.
[0113] Feature enhancement processing module: The semantic vector sequence undergoes several feature enhancement processes to obtain an enhanced semantic vector sequence. Each feature enhancement process includes multi-head attention processing, residual connection, normalization, and feedforward fully connected processing.
[0114] Entity recognition module: The enhanced semantic vector sequence is projected onto a query key pair space through a linear transformation. The query key pair is segmented into a query vector and a key vector. Dynamic frequency rotation position encoding is performed on the query vector and key vector respectively to obtain the transformed query vector and key vector, which correspond to the start vector and end vector of each entity category at each position. For each entity category, several start positions and end positions are set. These start and end positions are combined to obtain several start-end position pairs. Based on the transformed query vector and key vector, the matching score of the text fragments corresponding to all start-end position pairs is calculated to indicate that they belong to a certain entity category. All matching scores are processed by an activation function. Based on a preset threshold, start-end position pairs with scores higher than the preset threshold are selected and marked as the entity boundaries of the corresponding entity category.
[0115] Comparative and ablation experiments were conducted in an environment using Python 3.8, PyTorch 1.10.1, CUDA 11.3, and an RTX 3090 (24GB) GPU. The experimental parameters are shown in Table 3.
[0116] Table 3 Experimental Parameter Settings
[0117]
[0118] To verify the effectiveness of this invention, comparative experiments were conducted with various existing entity recognition methods. The results are shown in Table 4. In Table 4, the optimal values for all indicators are marked in bold, while the suboptimal results are marked with underlines.
[0119] Table 4 Comparison Experiment Results of Entity Recognition Models
[0120]
[0121] The three evaluation metrics in Table 4 are precision (P), recall (R), and F1 score (F1). Higher values for these metrics indicate better performance. Compared to the BERT-GlobalPointer model, this invention improves precision, recall, and F1 score by 6.09%, 11.22%, and 8.53%, respectively. This demonstrates that contextual feature extraction enhances the model's semantic understanding ability, particularly through a significant improvement in recall. This fully proves the crucial role of feature enhancement in reducing false negatives and achieves optimal performance in the CEC Chinese entity recognition task compared to other models.
[0122] To scientifically evaluate the role of each sub-module in this invention, three different ablation experiments were conducted: (1) removal of feature enhancement processing, denoted as "No-S3"; (2) removal of Dynamic Frequency RoPE (DF-RoPE), denoted as "No-DF-RoPE"; and (3) replacement of operation S4 with BiLSTM-CRF, denoted as "No-S4". The results of the ablation experiments are shown in Table 5.
[0123] Table 5. Results of Ablation Comparison Experiment
[0124]
[0125] As shown in Table 5, the contributions of each module to the present invention vary. First, after removing the feature enhancement processing (No-S3), the F1 score decreased by 1.67%, indicating that the feature enhancement processing played a significant role in capturing deep contextual information and improving the ability to distinguish entity boundaries. Second, when removing the dynamic frequency rotation position coding (No-DF-RoPE), the overall performance of the present invention decreased by only 0.16%, indicating that the dynamic frequency rotation position coding is helpful for fine-grained modeling of the start and end positions of entities, but its impact is relatively limited. Finally, when BiLSTM-CRF was used to replace the operation of S4 (No-S4), the F1 score decreased by 3.88%, further verifying that the operation of S4 is superior to traditional entity recognition methods in global span modeling and negative sample suppression.
[0126] To verify the effectiveness of this invention in complex entity recognition scenarios, complex long sentences containing multiple dense entity types and ambiguous boundaries (covering entities such as time and location, where long entities and dense event descriptions pose a recognition challenge) were selected. The results were compared between BiLSTM-CRF without a pre-trained language model and RoBERTa-BiLSTM-CRF without a multi-layer residual structure. The learning results are shown in Table 6.
[0127] Table 6 Case Study Results
[0128] Sample A 6.2-magnitude earthquake struck Jishishan County, Bao'an Ethnic and Liberal Autonomous Prefecture, Linxia Prefecture, Gansu Province. The [I-PAR] Emergency Management Bureau immediately activated a Level I emergency response, establishing a 7B-OBJ.20 [I-OBJ] Rainstorm [I-OBJ] Emergency Command Center [I-OBJ] Temporary [I-OBJ] Sub-branch [I-OBJ] Organization [I-OBJ]... BiLSTM-CRF <![CDATA[ Gansu Linxia Prefecture Jishishan [I-LOC] Bao [I-LOC] An [I-LOC] Ethnic Group [I-LOC] Dong [I-LOC] Township [I-LOC] Ethnic Group [I-LOC] Sa [I- LOC]La[I-LOC]Ethnic[I-LOC]Autonomous[I-LOC]County[I-LOC] Following the occurrence of a 6.2 magnitude earthquake, the Jishishan Emergency Management Bureau immediately activated a Level I emergency response and established [a response team / organization]. 7[B-PAR].[I-PAR]2[I- PAR]0[I-PAR]storm[I-PAR]rain[I-PAR]respond[I-PAR]emergency[I-PAR]point[I-PAR]wake[I-PAR] Department [I-PAR] Pro [I-PAR] Time [I-PAR] Branch [I-PAR] Branch [I-PAR] Machine [I-PAR] Structure [I-PAR] …]]> RoBERTa-BiLSTM-CRF <![CDATA[Jishishan Bao'an, Dongxiang, Sala Autonomous County, Linxia Prefecture, Gansu Province, experienced a magnitude 6.2 earthquake. The Jishishan Emergency Management Bureau immediately activated a Level-I emergency response and established 7[B-OBJ].[I-OBJ]2[I- OBJ]0[I-OBJ]Rainstorm[I-OBJ]Ying[I-OBJ]Urgent[I-OBJ]Point[I-OBJ]Wall[I-OBJ] [I-OBJ] Temporary Branch … <!-- 10 -->]]> This invention A 6.2-magnitude earthquake struck Jishishan County, Bao'an Ethnic and Liberal Autonomous Prefecture, Linxia Prefecture, Gansu Province. The [I-PAR] Emergency Management Bureau immediately activated a Level I emergency response, establishing a 7B-OBJ.20 [I-OBJ] Rainstorm [I-OBJ] Emergency Command Center [I-OBJ] Temporary [I-OBJ] Sub-branch [I-OBJ] Organization [I-OBJ]...
[0129] Table 6 shows the BIO tagging results of key entity segments extracted from emergency texts related to the 2023 Gansu Jishishan earthquake. The core validation dimensions include long location identification, temporary emergency organization classification, and entity boundary integrity. Regarding long location identification, BiLSTM-CRF, due to its limited ability to model long-distance dependencies, split the extended location "Gansu Linxia Prefecture Jishishan Bonan, Dongxiang, and Salar Autonomous County" into two independent entities—"Gansu Linxia Prefecture" and "Jishishan"—damaging location integrity. While RoBERTa-BiLSTM-CRF successfully identified the complete location string, it primarily relied on pre-trained semantic representations from RoBERTa, rather than fine-tuning for this task. In contrast, this invention effectively captures cross-token semantic associations, fully identifying the location entity while maintaining computational efficiency.
[0130] Regarding the extraction of temporary emergency organizations, BiLSTM-CRF failed to treat "7.20 Rainstorm Emergency Command Temporary Branch" as an independent entity and incorrectly categorized it as "Participant," demonstrating a clear lack of domain adaptation. While RoBERTa-BiLSTM-CRF labeled the entire phrase as "Object," it failed to distinguish between temporary and permanent organizations. In contrast, this invention achieves accurate classification of this type of entity, "Object," by adjusting the positional encoding frequency of the temporary organization name using DF-RoPE.
Claims
1. A method for named entity recognition of an emergency event, characterized in that, The method comprises the following steps: S1, obtaining an original text sequence, and labeling tags for the original text sequence word by word; The original text sequence is segmented by a dynamic sliding window mechanism, and invalid texts are removed to obtain a processed text sequence; S2, converting the processed text sequence into a Token sequence, masking part of the characters in the Token sequence, and obtaining an updated Token sequence; The updated Token sequence is converted into a plurality of embedding representations through embedding processing, and the plurality of embedding representations are added to obtain an embedding sequence; The embedding sequence is subjected to several times of context feature extraction to obtain a semantic vector sequence, and each time of context feature extraction comprises multi-head attention processing and feedforward full connection processing; S3, the semantic vector sequence is subjected to several times of feature enhancement processing to obtain an enhanced semantic vector sequence, and each time of feature enhancement processing comprises multi-head attention processing, residual connection, normalization and feedforward full connection processing; S4, the enhanced semantic vector sequence is projected into a query key pair space through linear transformation, the query key pair is divided into a query vector and a key vector, dynamic frequency rotation position encoding is performed on the query vector and the key vector respectively to obtain transformed query vectors and key vectors respectively corresponding to the start vector and the end vector of each entity category at each position; For each entity category, a plurality of start positions and end positions are set, and the plurality of start positions and end positions are combined to obtain a plurality of start-end position pairs; According to the transformed query vectors and key vectors, the matching scores of the text segments corresponding to all start-end position pairs belonging to a certain entity category are calculated; All matching scores are processed by an activation function, and according to a preset threshold, start-end position pairs with scores higher than the preset threshold are screened out and marked as entity boundaries of the corresponding entity category; The operation of dynamic frequency rotation position encoding is specifically: For each starting position query vector and finish line key vector Dynamic frequency rotation position encoding is performed on each vector to obtain the encoded query vector. and key vector The specific formula is as follows: , , wherein is a base frequency parameter; m represents an index of the query vector is a base frequency parameter; n represents an index of the key vector ; and is a start position and an end position is a dynamic frequency adjustment factor, denotes a component of the query vector in the 2tth dimension; denotes a component of the query vector in the 2t+1th dimension; denotes a component of the key vector in the 2tth dimension; denotes a component of the key vector in the 2t+1th dimension.
2. The method of claim 1, wherein, The operation of the dynamic sliding window mechanism in S1 is specifically: The dynamic sliding window slides with a preset length and a certain step size, detects entities in the window, and when the end position of an entity is detected to be outside the end position of the current window, the dynamic sliding window is expanded until it contains a complete entity, and intelligent truncation is realized based on punctuation marks; Repeat the above operation until the entire original text sequence is covered.
3. The method of claim 2, wherein, The operation of expanding the dynamic sliding window is specifically: extended end position of the kth dynamic sliding window determined by the maximum length constraint, the entity boundary constraint and the punctuation, and the specific formula is as follows: , wherein, is the preliminary end position of the window, is the start position of the window, maximum length constraint = 50, denotes the end position of an entity, denotes the set of entities in the current window, is the entity boundary constraint, is the set of positions of all punctuation marks in the original text sequence, is the set of positions of all punctuation marks in the original text sequence, is the position of a certain punctuation mark in the set of positions of all punctuation marks in the original text sequence. 4.The method of claim 1, wherein, The operation of multi-head attention processing in S2 is specifically: The embedding sequence generates a query matrix, a key matrix and a value matrix through linear mapping, and the query matrix, the key matrix and the value matrix are divided into h sub-matrices respectively, corresponding to h attention heads; Each attention head independently calculates a weighted sum, and the weighted sums of the h attention heads are spliced to obtain a weighted sum sequence; The weighted sum sequence is linearly transformed to obtain a multi-head attention output. 5.The method of claim 1, wherein, S2 predicts the masked words according to the context information, and predicts the probability distribution of the words masked at the first position , and the specific formula is as follows: , wherein, is a sequence of semantic vectors, is a sequence of semantic vectors is a semantic vector corresponding to a masked position m in is a bias term. 6.The method of claim 4, wherein, The specific formula for calculating the weighted sum is as follows: wherein, is an activation function, , , Qi, Kj, Vjare the i-th, j-th sub-matrix of the query matrix Q, the key matrix K, the value matrix V respectively, is the transpose matrix of , is a scaling factor.
7. The method of claim 1, wherein, The specific calculation of the matching score in S4 is: For each entity category c and each pair of locations Compute the match score under this category: , wherein the inner product measures the degree of association between the th Token as the start of an entity and the th Token as the end of an entity in the semantic space, is a scaling factor. 8.The method of claim 1, wherein, The operation of adding the plurality of embedding representations to obtain the embedding sequence in S2 is specifically: For each position in the text sequence , the embedding sequence is obtained by adding a plurality of embedding representations, including a word embedding, a position embedding, and a segment embedding, according to the following formula: , wherein, is an embedding sequence, , is a vocabulary embedding, is a position embedding, is a segment embedding.
9. A system for named entity recognition of incidents, characterized in that, It comprises: A text preprocessing module: obtaining an original text sequence, and labeling tags for the original text sequence word by word; The original text sequence is segmented by a dynamic sliding window mechanism, and invalid texts are removed to obtain a processed text sequence; The context feature extraction module: the processed text sequence is converted into a token sequence, a part of characters in the token sequence is masked to obtain an updated token sequence, and the updated token sequence is converted into a plurality of embedding representations through embedding processing, and the plurality of embedding representations are added to obtain an embedding sequence; The embedding sequence is subjected to a plurality of times of context feature extraction to obtain a semantic vector sequence, and each time of context feature extraction includes multi-head attention processing and feedforward full connection processing; The feature enhancement processing module: the semantic vector sequence is subjected to a plurality of times of feature enhancement processing to obtain an enhanced semantic vector sequence, and each time of feature enhancement processing includes multi-head attention processing, residual connection, normalization and feedforward full connection processing; The entity recognition module: the enhanced semantic vector sequence is projected into a query key pair space through linear transformation, the query key pair is divided into a query vector and a key vector, the query vector and the key vector are subjected to dynamic frequency rotation position coding to obtain transformed query vectors and key vectors, respectively corresponding to start vectors and end vectors of each entity category at each position; for each entity category, a plurality of start positions and end positions are set, and the plurality of start positions and end positions are combined to obtain a plurality of start-end position pairs; according to the transformed query vectors and the key vectors, the matching scores of the text segments corresponding to all the start-end position pairs belonging to a certain entity category are calculated; all the matching scores are processed through an activation function, and according to a preset threshold, start-end position pairs with scores higher than the preset threshold are screened out and marked as entity boundaries of the corresponding entity category; The operation of dynamic frequency rotation position coding is specifically as follows: For each starting position query vector and finish line key vector Dynamic frequency rotation position encoding is performed on each vector to obtain the encoded query vector. and key vector The specific formula is as follows: , , wherein is a base frequency parameter; m represents an index of the query vector is a base frequency parameter; n represents an index of the key vector ; and is a start position and an end position is a dynamic frequency adjustment factor, denotes a component of the query vector in the 2tth dimension; denotes a component of the query vector in the 2t+1th dimension; denotes a component of the key vector in the 2tth dimension; denotes a component of the key vector in the 2t+1th dimension.
Citation Information
Patent Citations
Supply chain financial intelligent duplicate checking method and device, equipment and medium
CN115525739A
Rock burst intelligent early warning and prevention system and method based on large language model
CN120338434A