Chinese named entity recognition method and system based on mamba-gcn double-span feature fusion and global pointer
By employing Mamba-GCN dual-span feature fusion and the GlobalPointer decoding model, the problems of long-distance context modeling and multi-source feature fusion in Chinese named entity recognition are solved, improving recognition accuracy and robustness, and making it suitable for Chinese named entity recognition tasks in multiple fields.
Patent Information
- Application Number
- CN202611517407.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-29
- Publication Date
- 2026-11-24
AI Technical Summary
Existing Chinese named entity recognition methods suffer from problems such as insufficient long-distance context modeling capabilities, inadequate multi-source feature fusion, weak model noise resistance, low utilization of complex structural information, and low decoding efficiency of nested entities.
We employ Mamba state space network and graph convolutional network (GCN) for dual-span feature fusion, combined with cross-branch interactive attention mechanism, to guide noise injection through the spatial structure features output by GCN, and use the GlobalPointer decoding model for entity recognition.
It improves the accuracy and generalization ability of Chinese named entity recognition, effectively handles nested entities in complex Chinese text, and enhances the robustness and decoding efficiency of the model.
Smart Images

Figure CN123159341A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of natural language processing technology, specifically to a Chinese named entity recognition method based on Mamba-GCN (Mamba State Space Network, Graph Convolutional Network (GCN)) dual-span feature fusion and GlobalPointer decoding model. This method can be applied to natural language processing tasks such as text information extraction, knowledge graph construction, intelligent question answering, and medical text analysis. Background Technology
[0002] Named entity recognition (NER) is one of the most fundamental and crucial tasks in the field of natural language processing. Its core objective is to automatically identify and extract meaningful entity references from unstructured, unstructured text data, such as names of people, places, organizations, time expressions, quantity expressions, and specialized entities in the medical field like diseases, drugs, and symptoms. NER is a key prerequisite for advanced natural language processing (NLP) tasks such as information extraction, knowledge graph construction, relation extraction, event extraction, and machine translation.
[0003] Compared with natural languages such as English, Chinese named entity recognition faces more severe and unique challenges, mainly in the following aspects:
[0004] 1. Lack of clear word boundaries: Chinese text does not use spaces as word separators, making word segmentation itself a challenge. Entity recognition and word segmentation errors can propagate to each other, severely impacting final performance.
[0005] 2. Highly complex entity structure: Chinese entities contain a large number of nested and discontinuous entities, which traditional sequence labeling models cannot effectively handle.
[0006] 3. Poor domain adaptability: Entity types and distributions vary greatly across different domains. A model that performs well in one domain often experiences a sharp decline in performance when transferred to another.
[0007] 4. High ambiguity and rare entities: Chinese words often have multiple meanings, and there are a large number of entities that do not appear or rarely appear in the training samples.
[0008] To address these issues, researchers have conducted extensive research, and the technological evolution can be broadly divided into three stages:
[0009] Phase 1: Rule-based and dictionary-based methods. Early systems primarily relied on rule templates manually constructed by domain experts and large dictionaries for matching. While achieving high accuracy on a small scale and within specific domains, these methods were costly to build, had extremely poor portability, and limited rule coverage, making them unable to handle complex linguistic phenomena beyond the scope of the rules.
[0010] The second stage: Statistical machine learning-based methods. With the establishment of labeled corpora, models such as Hidden Markov Models (HMMs), Maximum Entropy Markov Models (MMMs), and Conditional Random Fields (CRFs) were introduced into the NER task. These methods transform NER into a sequence labeling problem, training the model using manually designed features. Compared to rule-based methods, their generalization ability has been significantly improved. However, feature engineering still heavily relies on expert knowledge and struggles to capture deep semantic features.
[0011] The third stage: Methods based on deep learning and pre-trained models. In recent years, with the development of pre-trained language models such as BERT and RoBERTa, NER has made significant progress. Pre-trained models can learn rich contextual semantic information from massive amounts of text, providing high-quality dynamic word vectors for downstream tasks. Building on this, researchers have further combined sequence modeling networks such as BiLSTM and Transformer to enhance context dependency modeling capabilities. In recent years, Mamba networks based on state-space models have gradually become a new research hotspot in the field of natural language processing due to their ability to efficiently model long-distance context dependencies through selective state update mechanisms, and their linear computational complexity and high inference efficiency, providing new solutions for NER tasks.
[0012] Despite the tremendous success of existing deep learning methods, the following key technical shortcomings have been exposed when faced with increasingly complex application requirements:
[0013] 1. The limited scope and inadequacy of feature extraction: While existing named entity recognition models can extract textual contextual features using networks such as BiLSTM and Transformer, most focus on single-sequence semantic modeling, failing to adequately utilize the implicit structural relationships within the text. They struggle to simultaneously consider global temporal dependencies and spatial structural relationships, thus limiting the recognition performance of complex entities. Existing methods primarily rely on sequence modeling to obtain temporal contextual information, lacking the ability to model the potential graph structural relationships between characters. For example, in the phrase "flights from Beijing to Shanghai," "Beijing" and "Shanghai" are location entities, and they have an implicit "departure-destination" structural relationship with the predicate "to." Simple sequence models struggle to explicitly model such discontinuous, structured semantic relationships.
[0014] 2. The multi-source feature fusion mechanism is too simplistic and crude: When a few models attempt to fuse multiple features, the commonly used fusion strategy is simply vector concatenation or weighted averaging. This linear fusion method fails to uncover the deep interactions and synergistic enhancement information between different feature spaces. For example, global temporal semantic features and spatial structural features should corroborate and complement each other, but simple concatenation cannot achieve this "1+1>2" fusion effect.
[0015] 3. Insufficient robustness and generalization ability of the model: Text data in real-world applications often contains a lot of noise, such as typos, non-standard expressions, and formatting errors. Existing models are usually trained and tested on meticulously cleaned benchmark datasets, making them extremely sensitive to unseen noise distributions and prone to overfitting, resulting in a significant drop in performance in real-world environments.
[0016] 4. Decoding strategies struggle to balance efficiency and accuracy: Traditional Conditional Random Field (CRF) decoding, based on dynamic programming, guarantees global optimality of the label sequence, but suffers from high time complexity and low decoding efficiency. Furthermore, its linear chain structure makes it difficult to handle nested entities. To address the nested entity problem, researchers have proposed span-based methods, such as directly predicting the category of all possible text segments. While theoretically capable of solving the nesting problem, this approach is computationally complex and practically infeasible for long texts, limiting its real-world application.
[0017] In summary, existing Chinese named entity recognition methods still suffer from problems such as insufficient long-distance context modeling capabilities, inadequate multi-source feature fusion, low utilization of complex structural information, and room for improvement in model robustness. To address these issues, this invention proposes a Chinese named entity recognition method based on Mamba state-space network, graph convolutional network (GCN) dual-span feature fusion, and the GlobalPointer decoding model. Summary of the Invention
[0018] This invention addresses the shortcomings of existing methods, such as insufficient long-range context modeling capabilities, simplistic multi-source feature fusion mechanisms, weak model noise resistance, low utilization of complex structural information, and low decoding efficiency of nested entities. It provides a Chinese named entity recognition method and system based on Mamba-GCN dual-span feature fusion and GlobalPointer. This invention establishes long-range contextual dependencies in text through a Mamba state-space network, extracts spatial structural features of text using a graph convolutional network, and achieves deep fusion of temporal semantic features and spatial structural features using a cross-branch interactive attention mechanism. Simultaneously, it determines the structural correlation degree of different token positions based on the spatial structural features output by GCN, and adaptively injects noise into the fused features according to the structural correlation degree. Finally, it achieves high-precision and highly robust Chinese named entity recognition through a GlobalPointer decoding model.
[0019] A Chinese named entity recognition method based on Mamba-GCN dual-span feature fusion and GlobalPointer includes the following steps:
[0020] Step 1: Encode the Chinese text sequence to obtain character-level context embedding vectors;
[0021] Step 2: Input the embedded vectors into the Mamba state space network to extract the global temporal semantic feature vector; simultaneously input them into the GCN network to extract the spatial structure feature vector, thereby obtaining the global temporal semantic feature vector and the spatial structure feature vector;
[0022] Step 3: The global temporal semantic feature vector and the spatial structure feature vector are fused through a cross-branch interactive attention fusion mechanism to generate a fused feature vector;
[0023] Step 4: Calculate the structural correlation degree of each token position based on the spatial structural feature vector output by GCN, and adaptively determine the noise perturbation intensity based on the structural correlation degree. Perform differentiated noise injection on the fused feature vector to obtain the structure-guided adaptive perturbation feature.
[0024] Step 5: Input the structure-guided adaptive perturbation features into the GlobalPointer decoding model, and output entity category and entity boundary information through the decoding model.
[0025] The present invention also provides a Chinese named entity recognition system based on Mamba-GCN dual-span feature fusion and GlobalPointer. The system is used to implement the recognition method and includes a text encoding module, a dual-span feature extraction module, a feature fusion and enhancement module, and an entity decoding output module.
[0026] The text encoding module is used to encode the input Chinese text sequence into a character-level embedding vector;
[0027] The dual-span feature extraction module is used to extract global temporal semantic features and spatial structure features;
[0028] The feature fusion and enhancement module is used to realize cross-branch interactive attention fusion, and to perform structure-guided adaptive noise injection on the fused features based on the spatial structure features output by GCN;
[0029] The entity decoding output module is used to perform GlobalPointer decoding and output the entity recognition results.
[0030] The beneficial effects of this invention are:
[0031] The recognition method described in this invention utilizes a Mamba network to establish long-distance contextual dependencies, combines GCN to extract text spatial structure features, achieves deep fusion of multi-source features through cross-branch interactive attention, and guides the noise injection intensity in the fused features based on the spatial structure features output by GCN to achieve structure-related differential perturbations, thereby improving the accuracy and generalization ability of complex Chinese named entity recognition.
[0032] The recognition method described in this invention, after completing global temporal semantic feature extraction using a Mamba state-space network, spatial structure feature extraction using a graph convolutional network, and cross-branch interactive attention fusion, does not use a Conditional Random Field (CRF) for sequence labeling. Instead, it directly inputs the fused features into the GlobalPointer decoding model for entity boundary recognition and entity type determination. Specifically, it possesses the following technical advantages:
[0033] 1. Comprehensive and in-depth feature extraction: Long-distance contextual dependencies of text sequences are established through the Mamba state space network to fully explore global temporal semantic information; spatial structural association features between characters are extracted through GCN to achieve complementary fusion of temporal semantic features and spatial structural features for the recognition of complex Chinese named entities;
[0034] 2. Advanced feature fusion mechanism: It adopts a cross-branch interactive attention mechanism to achieve deep alignment and adaptive fusion of temporal and spatial structural features, avoiding information loss caused by simple splicing;
[0035] 3. Significantly improved model robustness: The spatial structure features output by GCN are used to guide noise injection, and the noise perturbation intensity is adaptively adjusted according to the structural correlation of different token positions to achieve differentiated noise injection and improve the model's adaptability to noisy data and complex text;
[0036] 4. Balancing decoding efficiency and accuracy: Employing the GlobalPointer decoder, it supports nested entity recognition and achieves global parallel decoding, improving recognition accuracy while maintaining high inference efficiency;
[0037] 5. Excellent performance on multi-domain datasets: It achieves leading F1 scores on multiple Chinese NER datasets such as CMeEE-V2, MSRA, and People's Daily, and is especially suitable for entity extraction tasks in fields such as medical, news, and finance. Attached Figure Description
[0038] Figure 1 The flowchart shows the Chinese named entity recognition method based on Mamba-GCN dual-span feature fusion and GlobalPointer as described in this invention.
[0039] Figure 2 This is a schematic diagram of the GCN network structure in this invention;
[0040] Figure 3 This is an example diagram of Globalpointer decoding in this invention;
[0041] Figure 4 This is a comparison diagram of the invention with other models. Detailed Implementation
[0042] Specific Implementation Method 1: Combination Figures 1 to 4 This implementation describes a Chinese named entity recognition method based on Mamba-GCN dual-span feature fusion and GlobalPointer, proposing an end-to-end recognition framework. First, the input text is encoded using a RoBERTa-wwm-ext pre-trained language model to fully mine the contextual semantic information of words, obtaining a text representation with rich semantic features. Then, the contextual representation is input into a Mamba state space network, and long-distance contextual dependencies in the text sequence are dynamically modeled based on a selective state space model. A selective state update mechanism adaptively retains key information and filters redundant information, generating global temporal semantic features. Simultaneously, a graph structure corresponding to the text is constructed, and a graph convolutional network (GCN) is used to model the structural relationships between words, extracting spatial structural features.
[0043] Then, a cross-branch interactive attention fusion mechanism is used to achieve deep fusion of temporal semantic features and graph structure features. Based on the spatial structure features output by GCN, the structural correlation degree at different token positions is calculated. The noise perturbation intensity at different token positions is adaptively determined based on this structural correlation degree, and differentiated noise injection is implemented into the fused feature vector to improve the model's adaptability to complex text and noisy data. Finally, the structure-guided adaptive perturbation features are input into the GlobalPointer decoder to globally model entity boundaries, achieving accurate recognition of Chinese named entities. This is specifically implemented through the following steps:
[0044] Step S1. Input a Chinese text sequence and encode it using the Chinese full-word mask extended pre-trained language model (RoBERTa-wwm-ext) to obtain a character-level context embedding vector;
[0045] In this embodiment, the RoBERTa-wwm-ext pre-trained model is trained using a full-word masking strategy, which can better model the semantics of Chinese words. The pre-trained model includes a 12-layer Transformer encoder, with each layer containing 768 hidden units. The input Chinese text sequence is encoded by the RoBERTa-wwm-ext pre-trained model, and the 12-layer Transformer encoder captures contextual information, outputting a 768-dimensional character-level context embedding vector. The specific implementation process is as follows:
[0046] Input Chinese text sequence Encoding is performed using the RoBERTa-wwm-ext pre-trained model. During encoding, the pre-trained model constructs an input representation for each character: ,in, For character embedding vectors, For position encoding, Sentence segmentation and encoding are performed. Contextual information is captured layer by layer through a 12-layer Transformer encoder. The self-attention calculation formula is:
[0047]
[0048] In the formula, For querying the matrix, The key matrix, The value matrices are all obtained by linear transformation of the input features. This is the scaling factor.
[0049] The output of each layer is fed into the next layer after residual connection and layer normalization. After 12 layers of stacked computation, the final output is a character-level context embedding vector sequence. ,in For the first The embedding vectors of each character integrate the character's own semantics and its contextual information, providing a high-quality feature representation for subsequent feature extraction.
[0050] Step S2. The embedding vector The inputs are respectively fed into the Mamba state space network and the graph convolutional network (GCN). The Mamba state space network uses a selective state space model to dynamically model long-distance contextual dependencies in the text sequence and extracts global temporal semantic feature vectors. The GCN performs message passing and feature aggregation on the text character graph, learns the spatial structural relationships between characters, and outputs spatial structural feature vectors. Finally, the global temporal semantic feature vector and the spatial structural feature vector are obtained.
[0051] In this embodiment, the character-level context embedding vector sequence output in step S1 is input into the Mamba state space network and GCN respectively for dual-span feature extraction; the specific process of using the Mamba state space network to extract global temporal semantic features is as follows:
[0052] First, the Mamba state-space network linearly maps the 768-dimensional character-level context embedding vector output by the RoBERTa-wwm-ext pre-trained model, converting it into a state-space representation. Then, a selective state-space model is used to dynamically update the state of the input sequence, adaptively adjusting the state transition process according to the current input content, thus achieving long-distance contextual dependency modeling while maintaining linear computational complexity. Finally, a 768-dimensional global temporal semantic feature vector is generated through output mapping, providing a high-quality temporal semantic representation for subsequent cross-branch interactive attention fusion.
[0053] In this embodiment, the specific process of extracting spatial structure features using GCN is as follows:
[0054] First, construct the input text as a character node graph, with each character as a node in the graph, for a total of . Each node represents a character. The construction of edges in the graph comprehensively considers the relative positions of characters within the sentence and their local contextual relationships, employing a sliding window strategy to establish connections between characters. For any given node, connections are established with its preceding and following nodes. An edge is established between adjacent nodes, where the window size can be set according to the text length, preferably 3, thereby constructing an adjacency matrix of the text character graph.
[0055] Then, the character-level context embedding vectors output by the RoBERTa-wwm-ext pre-trained model are used as the initial feature input to the GCN for nodes. A two-layer GCN is employed to perform message passing and feature aggregation on the node features, with each layer having an output dimension of 768. The first-layer GCN aggregates information from adjacent nodes, learning the local structural association features between characters. The second-layer GCN further expands the receptive field of the nodes, fully integrating contextual structural information over a wider range, ultimately obtaining the spatial structural feature vector corresponding to each character. This provides a spatial structural representation for subsequent cross-branch interactive attention fusion with the global temporal semantic features extracted by Mamba.
[0056] In this embodiment, the GCN calculation formula is as follows:
[0057]
[0058] in, The input feature vector is used as the input to the GCN. These are the weights of the first and second layers of the neural network, respectively. This is the Sigmoid activation function. For the case containing the identity matrix The original text character graph adjacency matrix The normalized matrix is shown below:
[0059]
[0060] in, The adjacency matrix of the original text character graph. For the adjacency matrix of the original text character graph The corresponding degree diagonal matrix.
[0061] Step S3. The global temporal semantic feature vector and the spatial structure feature vector are fused through a cross-branch interactive attention fusion mechanism to generate a fused feature vector; the specific implementation process is as follows:
[0062] The global temporal semantic feature vector extracted by the Mamba state-space network and the spatial structure feature vector extracted by the GCN are input into a cross-branch interactive attention fusion mechanism for deep fusion. Bidirectional attention computation enables information interaction and collaborative enhancement between the two types of features, allowing the cross-branch interactive attention fusion mechanism to simultaneously consider the contextual semantic information and structural association information of the text, ultimately generating a fused feature vector. Using global temporal semantic features as query and key vectors and spatial structure features as value vectors, attention weights are calculated. Through multi-head attention parallel processing, residual connections, and layer normalization, the two types of features interact and collaboratively enhance each other, generating a fused feature vector.
[0063] First, the global temporal semantic features output by the Mamba state-space network are used as query vectors. and key vector The spatial structure features output by GCN are used as value vectors. The correlation between two types of features is calculated by scaling dot product attention, and the interaction relationship between features is learned from different semantic subspaces by using a multi-head attention mechanism.
[0064] Then, the weighted output is residually concatenated with the global temporal semantic features output by the original Mamba state space network, and subjected to Layer Normalization to obtain the fused temporal enhanced features, such as... Figure 2 As shown, enter Chinese text. The character-level token nodes in the input text first pass through a token embedding layer, converting the character sequence into a continuous vector representation. Then, contextual semantic modeling is performed using a multi-layer Transformer encoder in RoBERTa-wwm-ext. Within each Transformer layer, a self-attention mechanism is used to calculate the association weights between characters, enabling each character representation to incorporate global contextual information. After multi-layer encoding, the output is a sequence of character-level embedding vectors containing rich contextual semantic information, providing input for subsequent Mamba state space network and GCN spatial structure feature extraction.
[0065] In this implementation, the cross-branch interactive attention fusion mechanism fuses the global temporal semantic feature vector and the spatial structure feature vector based on the attention mechanism. To preserve the effective information in the global temporal semantic feature vector and improve the stability of network training, residual connections and Layer Normalization are introduced after the attention fusion result, as shown in the following formula:
[0066]
[0067] in, The global temporal semantic feature matrix representing the output of the Mamba state-space network; The spatial structure feature matrix representing the output of GCN; The dimension of the feature vector; It is the softmax activation function; Representative layer normalization operation; This indicates a feature concatenation operation.
[0068] In this embodiment, directly concatenating the two types of features makes it difficult to fully model the relationship between temporal semantic information and spatial structural information, easily leading to information fragmentation between different feature spaces. Therefore, this invention employs a cross-branch interactive attention fusion mechanism. Through attention calculation across feature spaces, it achieves deep interaction between the global temporal semantic features extracted by the Mamba state space network and the spatial structural features extracted by the GCN, enabling the two types of features to guide and complement each other. To reduce the impact of differences in the distribution of the two types of features, firstly, linear mapping is performed on both types of features to project them onto a unified feature space; then, cross-branch interactive attention is used to learn the correlation between the two types of features, combined with residual connections and Layer Normalization to stabilize the network training process; finally, the bidirectional interactive features are concatenated to obtain a fused joint feature representation, providing richer and more discriminative feature expressions for subsequent adaptive noise injection and GlobalPointer decoding based on GCN spatial structural information.
[0069] Step S4. Using the spatial structure feature vector output by GCN in step S2, calculate the degree of local structural correlation between different token positions and their neighboring tokens, and adaptively determine the noise perturbation coefficient for the corresponding token position based on the degree of local structural correlation, so that different token positions have different noise perturbation intensities. Inject the differentiated noise generated based on the noise perturbation coefficient into the fused feature vector obtained in step S3, thereby obtaining the structure-guided adaptive perturbation feature. The specific implementation process is as follows:
[0070] Step S41. For the first Each token is based on the spatial structure feature vector output by GCN. The spatial structure features of the token and its neighboring tokens are used to calculate the first... Degree of local structural correlation among tokens The calculation formula is as follows:
[0071]
[0072] In the formula, Indicates the first The GCN spatial structure feature vector corresponding to each token; Indicates the first The set of neighboring tokens corresponding to each token; Represents the GCN spatial structure feature vector corresponding to the neighborhood Token(j); Indicates the first The degree of local structural association between an individual token and its neighboring tokens; A very small positive number set to prevent the denominator from being zero.
[0073] Step 42. Determine the first [unit / item] based on the degree of correlation of the local structures. Noise disturbance coefficient corresponding to each token The calculation formula is as follows:
[0074]
[0075] In the formula, Indicates the first The noise disturbance coefficient corresponding to each token; and These represent the preset minimum and maximum noise disturbance coefficients, respectively. Through the above calculations, different token positions receive different noise disturbance intensities based on their local structural correlation.
[0076] Step 43. Apply the noise perturbation coefficient to the random noise, and inject the resulting differentiated noise into the fusion feature vector obtained in step S3. For the first... Each token has the following perturbation characteristics:
[0077]
[0078] In the formula, This indicates that the result obtained in step S3 is the first... The fused feature vector corresponding to each token; This represents a random noise vector that follows a standard Gaussian distribution. Indicates the first The noise disturbance coefficient corresponding to each token; This represents the perturbation feature vector obtained after structure-guided adaptive noise injection.
[0079] By using the spatial structure information extracted by GCN, the noise injection process is dynamically adjusted so that tokens with different structural correlations receive different noise perturbation intensities. This avoids applying the same random perturbation method to all tokens, thereby improving the model's adaptability to local feature changes and complex text noise while preserving text structure information.
[0080] Step S5. Input the structure-guided adaptive perturbation features into the GlobalPointer decoding model, and output entity category and boundary location information, such as... Figure 3 As shown, this illustrates the process of generating entity start and end position vectors from fused feature vectors through linear mapping, and then obtaining the entity span prediction result through inner product calculation.
[0081] The structure-guided adaptive perturbation features output from S4 are input into the GlobalPointer decoding model and mapped to head and tail vectors. Relative positional encoding is introduced to calculate the score for all possible character spans. Multi-label classification training is performed using softmax + cross-entropy loss, outputting entity type and start / end position information to achieve accurate recognition of Chinese named entities. The specific implementation process is as follows:
[0082] Step 51. Generate the head vector and tail vector for each entity type using linear mapping, which represent the semantic information of the entity's start and end positions. The calculation formula is as follows:
[0083]
[0084]
[0085] In the formula, Indicates the entity type number. , The first The start and end position vectors for each entity type To enhance the post-text feature matrix, For the first The head and tail vectors of each entity type can learn weight matrices. Let be the dimension of the head and tail vectors.
[0086] In this embodiment, the structure-guided adaptive perturbation feature integrates the global temporal semantic features extracted by the Mamba state space network and the spatial structural features extracted by GCN, and implements differentiated noise perturbation according to the degree of local structural correlation at different token positions. Therefore, it can provide GlobalPointer with feature representations containing contextual semantic information and spatial structural information for entity boundary localization and entity type determination.
[0087] Step 52. Calculate the entity score for all consecutive subsequences, using the following formula:
[0088]
[0089] In the formula, and These represent the start and end positions of the subsequence, respectively. For the first The head vector at each position, For the first Tail vector at each position, Indicates from position arrive The subsequence is of type Scoring of entities;
[0090] Step 53. Train the system using a multi-label classification loss function, as shown in the following formula:
[0091]
[0092] In the formula, For the first Loss of various entity types For the positive sample set, For the negative sample set, Perform exponential transformations on the scores of both positive and negative samples; here we only need to consider... The combination is:
[0093]
[0094] in, This represents the set of all candidate entity position pairs that satisfy the condition that the starting position is no greater than the ending position. This loss function effectively mitigates the class imbalance problem by comparing the scores of positive and negative samples pairwise.
[0095] In this embodiment, during the decoding stage, the GlobalPointer model performs a global score on all possible character spans and outputs entity boundaries and entity categories that meet preset thresholds. Among these, the first... A collection of class entities is represented as: ,in Indicates the first The set of all entities of this type Ensure the starting position is no greater than the ending position. Unlike traditional CRF label-by-label decoding, GlobalPointer directly uses the entity span as the prediction object, enabling globally parallel decoding. This effectively avoids error propagation problems caused by label dependency and naturally supports the recognition of nested and overlapping entities. Because the input features integrate global temporal semantic information extracted from the Mamba state-space network, spatial structural information extracted from GCN, and structure-guided adaptive perturbation features, the GlobalPointer model can more accurately complete entity boundary localization and entity type determination, improving overall performance for complex Chinese named entity recognition. The final output entity recognition result includes entity category, entity starting position, and ending position, which can be directly applied to downstream natural language processing tasks such as knowledge graph construction, relation extraction, event extraction, and intelligent question answering.
[0096] like Figure 4 As shown, to demonstrate the superiority of this model, Figure 4The F1 scores of various Chinese named entity recognition models under different training data volumes are presented as comparison curves. The horizontal axis represents the percentage of training data volume, and the vertical axis represents the F1 score. The models compared include bidirectional long short-term memory network-conditional random field (CRF), pre-trained language model-conditional random field (CRF), and Mamba state space network-conditional random field (CRF) models. As the data volume increases from 10% to 100%, the F1 scores of all models increase. However, the method of this invention, based on Mamba-graph convolutional network dual-span feature fusion and global pointers, achieves the highest F1 score under all data volumes, and its advantage is more obvious when the data volume is low. This indicates that dual-span feature extraction, cross-branch interactive attention fusion, structure-guided adaptive noise injection, and global pointer decoding jointly improve recognition accuracy, generalization ability, and robustness.
[0097] Specific Implementation Method Two: This implementation method is a system for Chinese named entity recognition based on Mamba-GCN dual-span feature fusion and GlobalPointer, as described in Specific Implementation Method One. The system includes: a text encoding module, a dual-span feature extraction module, a feature fusion and enhancement module, and an entity decoding output module.
[0098] The text encoding module is used to encode the input Chinese text sequence into a character-level embedding vector;
[0099] The dual-span feature extraction module, connected to the text encoding module, is used to extract global temporal semantic features and spatial structure features;
[0100] The feature fusion and enhancement module, connected to the dual-span feature extraction module, is used to realize cross-branch interactive attention fusion and random noise injection, and to perform structure-guided adaptive noise injection on the fused features based on the spatial structure features output by GCN.
[0101] The entity decoding output module, connected to the feature fusion and enhancement module, is used to perform GlobalPointer decoding and output entity recognition results.
[0102] In this embodiment, the dual-span feature extraction module includes a global temporal semantic feature extraction unit and a spatial structure feature extraction unit, corresponding to the Mamba state space network and GCN, respectively. The Mamba state space network is responsible for establishing long-distance contextual dependencies, while the GCN is responsible for learning the spatial structure relationships within the text.
[0103] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0104] The embodiments described above are merely illustrative of several implementations of the present invention, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the invention patent. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of the present invention, and these all fall within the protection scope of the present invention. Therefore, the protection scope of this invention patent should be determined by the appended claims.
Claims
1. A Chinese named entity recognition method based on Mamba-GCN dual-span feature fusion and GlobalPointer, characterized by: This method is implemented by the following steps: Step 1: Encode the Chinese text sequence to obtain character-level context embedding vectors; Step 2: Input the embedded vectors into the Mamba state space network to extract the global temporal semantic feature vector; simultaneously input them into the GCN network to extract the spatial structure feature vector, thereby obtaining the global temporal semantic feature vector and the spatial structure feature vector; Step 3: The global temporal semantic feature vector and the spatial structure feature vector are fused through a cross-branch interactive attention fusion mechanism to generate a fused feature vector; Step 4: Calculate the structural correlation degree of each token position based on the spatial structural feature vector output by GCN, and adaptively determine the noise perturbation intensity based on the structural correlation degree. Perform differentiated noise injection on the fused feature vector to obtain the structure-guided adaptive perturbation feature. Step 5: Input the structure-guided adaptive perturbation features into the GlobalPointer decoding model, and output entity category and entity boundary information through the decoding model.
2. The identification method according to claim 1, characterized in that: In step one, the input representation for each character is constructed using the RoBERTa-wwm-ext pre-trained model: ,in, For character embedding vectors, For position encoding, The sentence is segmented and encoded; contextual information is captured through a multi-layer Transformer encoder, and finally a character-level context embedding vector is output.
3. The identification method according to claim 1, characterized in that: In step two, the character-level context embedding vector is input into the Mamba state space network and GCN respectively for dual-span feature extraction; The Mamba state-space network linearly maps the character-level context embedding vectors output by the pre-trained model to a state-space representation; then, it uses a selective state-space model to dynamically update the state of the input sequence, thereby modeling long-distance contextual dependencies; and generates a global temporal semantic feature vector through output mapping. The specific process of extracting spatial structure features using GCN is as follows: The input Chinese text sequence is constructed into a character node graph, and the adjacency matrix of the text character graph is constructed. The character-level context embedding vector output by the pre-trained model is used as the initial feature input of the node to the GCN, and two layers of GCN are used to perform message passing and feature aggregation on the node features, and finally the spatial structure feature vector corresponding to each character is obtained.
4. The identification method according to claim 1, characterized in that: In step three, the cross-branch interactive attention fusion mechanism uses the global temporal semantic feature vector as the query vector and key vector, and the spatial structure feature vector as the value vector to calculate attention weights. After multi-head attention parallel processing, residual connection and layer normalization, the two types of features interact and enhance each other to generate a fused feature vector.
5. The identification method according to claim 4, characterized in that: The cross-branch interactive attention fusion mechanism is based on the attention mechanism to fuse feature vectors. After the fusion result of the attention mechanism, residual connections and layer normalization are introduced, as shown in the following formula: ; In the formula, This is the global temporal semantic feature matrix; The spatial structure feature matrix; The dimension of the feature vector; It is the softmax activation function; Presentation layer normalization operation; This indicates a feature concatenation operation.
6. The identification method according to claim 1, characterized in that: In step four, the degree of local structural association between each token position and its neighboring tokens is calculated based on the spatial structural features output by GCN; the noise perturbation coefficient of the corresponding token position is adaptively determined based on the degree of local structural association; differentiated noise is generated based on the noise perturbation coefficient, and the differentiated noise is injected into the fusion feature vector obtained in step three to obtain structure-guided adaptive perturbation features.
7. The identification method according to claim 6, characterized in that: The implementation process of step four is as follows: Step 41: Based on the spatial structure feature vector output by GCN The spatial structure features of the tokens and their neighboring tokens are used to calculate the first... Degree of local structural correlation among tokens The formula is: ; In the formula, For the first The GCN spatial structure feature vector corresponding to each token; For the first The set of neighboring tokens corresponding to each token; Let be the GCN spatial structure feature vector corresponding to the neighborhood Token(j); It is a very small positive number; Step 4.2: Based on the degree of correlation of the local structures, determine the first... Noise disturbance coefficient corresponding to each token This allows different token positions to obtain different noise perturbation intensities based on their local structural correlation; the noise perturbation coefficient The formula is: ; In the formula, and These are the preset minimum noise disturbance coefficient and maximum noise disturbance coefficient, respectively; Step 4.3: Apply the noise perturbation coefficient to the random noise to obtain differentiated noise; inject the differentiated noise into the fusion feature vector described in Step 3; obtain the structure-guided adaptive perturbation feature.
8. The identification method according to claim 1, characterized in that: In step five, the structure-guided adaptive perturbation features obtained in step four are mapped into head and tail vectors through the GlobalPointer decoding model; relative position encoding is introduced to calculate the score of all character spans; multi-label classification training is performed through cross-entropy loss to output entity type and entity boundary information, thereby achieving accurate recognition of Chinese named entities.
9. The identification method according to claim 8, characterized in that: The specific implementation process of step five is as follows: Step 51: Generate the head vector and tail vector for each entity type using linear mapping, as shown in the following formula: ; ; In the formula, Number the entity type. , The first The start and end position vectors for each entity type This is the structure-guided adaptive perturbation feature matrix. The first The head and tail vectors of various entity types can learn weight matrices; Step 52: Calculate the entity score for all consecutive subsequences using the following formula: ; In the formula, For the first The head vector at each position, For the first Tail vector at each position, Indicates from position arrive The subsequence is of type Scoring of entities; Step 53: Train the system using a multi-label classification loss function, as shown in the following formula: ; In the formula, For the first Loss functions for various entity types For the positive sample set, For the negative sample set, These are the exponential forms of the scores for positive and negative samples, respectively.
10. A Chinese named entity recognition system based on Mamba-GCN dual-span feature fusion and GlobalPointer, characterized in that: The system is used to implement the recognition method as described in any one of claims 1-9, wherein the recognition system includes a text encoding module, a dual-span feature extraction module, a feature fusion and enhancement module, and an entity decoding output module; The text encoding module is used to encode the input Chinese text sequence into a character-level embedding vector; The dual-span feature extraction module is used to extract global temporal semantic features and spatial structure features; The feature fusion and enhancement module is used to realize cross-branch interactive attention fusion, and to perform structure-guided adaptive noise injection on the fused features based on the spatial structure features output by GCN; The entity decoding output module is used to perform GlobalPointer decoding and output the entity recognition results.
