A Chinese named entity recognition method, system, medium, device and program product

By embedding multi-dimensional semantic features and using a dynamic weight fusion mechanism, combining character, glyph, and phonetic features, the problem of insufficient accuracy in Chinese character recognition in traditional methods is solved, and the efficiency and robustness of Chinese named entity recognition are improved.

CN121503483BActive Publication Date: 2026-04-10MALANSHAN AUDIO & VIDEO LABORATORY
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-01-13
Publication Date
2026-04-10

Smart Images

  • Figure CN121503483B_ABST
    Figure CN121503483B_ABST
Patent Text Reader

Abstract

The application provides a Chinese named entity recognition method, system, medium, equipment and program product, relates to the object recognition field, and includes the following steps: obtaining to-be-recognized Chinese data; performing feature embedding on the to-be-recognized Chinese data to obtain Chinese character semantic information; obtaining input parameters of an attention mechanism according to character embedding representation vectors, font embedding representation vectors and phonetic embedding representation vectors and respective corresponding learnable parameter matrices; performing cross fusion according to the input parameters to obtain enhanced feature embedding; calling a gate selection function to determine respective fusion weights of enhanced character feature embedding, enhanced font feature embedding and enhanced phonetic feature embedding; inputting the enhanced feature embedding and the corresponding fusion weights into a sequence encoding layer to obtain sequence encoding, and performing label decoding on the sequence encoding by using a conditional random field to obtain a named entity recognition result. The application can effectively reduce ambiguity and improve the accuracy and robustness of recognition.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of natural language processing, and particularly to a Chinese named entity recognition method, system, medium, device and program product. Background Art

[0002] With the large-scale implementation of Chinese AI (Artificial Intelligence), higher accuracy and efficiency requirements are put forward for named entity recognition. Traditional methods do not utilize the unique glyph and pronunciation information of Chinese characters, making it difficult to handle out-of-vocabulary words and entity boundary ambiguities. Chinese characters have the function of pictographic ideography. For example, "Penghu" can be inferred as a geographical entity by borrowing the radical "氵" and the context; for polyphonic characters such as "Chang", in "Wuhan City / Yangtze River Bridge", through the pronunciation it can assist in correct segmentation. Single features are prone to weak generalization due to insufficient information, and integrating glyphs and pronunciations is expected to improve the accuracy and robustness of Chinese named entity recognition. Summary of the Invention

[0003] The purpose of this application is to provide a Chinese named entity recognition method, system, computer-readable storage medium, electronic device and computer program product, which can improve the accuracy of Chinese recognition.

[0004] To solve the above technical problems, this application provides a Chinese named entity recognition method, and the specific technical solution is as follows:

[0005] Obtain the Chinese data to be recognized;

[0006] Perform feature embedding on the Chinese data to be recognized to obtain Chinese character semantic information; the Chinese character semantic information includes a character embedding representation vector, a glyph embedding representation vector, and a pronunciation embedding representation vector;

[0007] According to the character embedding representation vector, the glyph embedding representation vector, and the pronunciation embedding representation vector, as well as their respective learnable parameter matrices, obtain the input parameters of the attention mechanism;

[0008] Perform cross-fusion according to the input parameters to obtain enhanced feature embeddings; the enhanced feature embeddings include enhanced character feature embeddings, enhanced glyph feature embeddings, and enhanced pronunciation feature embeddings;

[0009] Call a gating selection function to determine the fusion weights of the enhanced character feature embeddings, the enhanced glyph feature embeddings, and the enhanced pronunciation feature embeddings respectively;

[0010] Input the enhanced feature embeddings and their corresponding fusion weights into a sequence encoding layer to obtain a sequence encoding, and use a conditional random field to perform label decoding on the sequence encoding to obtain a named entity recognition result.

[0011] Optionally, the feature embedding of the to-be-identified Chinese data is performed to obtain Chinese character semantic information, which comprises:

[0012] The character feature recognition is performed on the to-be-identified Chinese data to obtain the character embedding representation vector.

[0013] The grapheme feature recognition is performed on the to-be-identified Chinese data to obtain the grapheme embedding representation vector.

[0014] The phonetic feature recognition is performed on the to-be-identified Chinese data to obtain the phonetic embedding representation vector.

[0015] Optionally, the character feature recognition is performed on the to-be-identified Chinese data to obtain the character embedding representation vector, which comprises:

[0016] The pre-trained language model is called to map each character in the to-be-identified Chinese data to a fixed-dimensional vector representation with reference to the character embedding lookup table, to obtain the character embedding representation vector.

[0017] Optionally, the grapheme feature recognition is performed on the to-be-identified Chinese data to obtain the grapheme embedding representation vector, which comprises:

[0018] An open source character image is obtained.

[0019] The open source character image is uniformly converted into a grayscale image of a set size, and the grayscale image is stacked into a three-dimensional tensor; the three-dimensional tensor contains the number of image channels and the length and width of the grayscale image, and the number of sentence characters is added as a tensor parameter.

[0020] The three-dimensional tensor is input into a convolution layer; the convolution layer contains two three-dimensional convolutions for converting a 1-channel grayscale image into a multi-channel image.

[0021] The multi-channel image is sequentially subjected to two-dimensional convolution and two-dimensional pooling to extract the grapheme embedding representation vector.

[0022] Optionally, the phonetic feature recognition is performed on the to-be-identified Chinese data to obtain the phonetic embedding representation vector, which comprises:

[0023] The to-be-identified Chinese data is converted into a corresponding pinyin sequence; wherein each Chinese character corresponds to a text pinyin information; the text pinyin information is represented by a Roman alphabet sequence and contains tone marks for representing Yin Ping, Yang Ping, Shangsheng, Quesheng and Qingsheng, respectively.

[0024] The local features of the pinyin sequence are extracted, and sequentially pass through a multi-head attention layer, a residual connection layer and a normalization layer to obtain the grapheme embedding representation vector; the multi-head attention layer is used to capture the global long-distance dependence of the text pinyin information.

[0025] Optionally, calling a gating selection function to determine the fusion weight of each of the enhanced character feature embedding, the enhanced grapheme feature embedding and the enhanced phonetic feature embedding comprises:

[0026] concatenating the enhanced character feature embedding, the enhanced grapheme feature embedding and the enhanced phonetic feature embedding to obtain a gated total input;

[0027] writing the gated input into a three-way selector to output a gating value corresponding to each of the character, pinyin and semantic channels; wherein the three-way selector comprises three linear selectors independently set with learnable parameters;

[0028] performing weighted summation on the enhanced character feature embedding, the enhanced grapheme feature embedding and the enhanced phonetic feature embedding with the gating value as a coefficient to obtain a fused feature.

[0029] The application also provides a Chinese named entity recognition system, comprising:

[0030] a data acquisition module configured to acquire Chinese data to be recognized;

[0031] a feature embedding module configured to perform feature embedding on the Chinese data to be recognized to obtain Chinese character semantic information; the Chinese character semantic information comprises a character embedding representation vector, a grapheme embedding representation vector and a phonetic embedding representation vector;

[0032] a parameter generation module configured to obtain input parameters of an attention mechanism according to the character embedding representation vector, the grapheme embedding representation vector and the phonetic embedding representation vector, and a learnable parameter matrix corresponding to each of the vectors;

[0033] a feature fusion module configured to perform cross-fusion according to the input parameters to obtain enhanced feature embeddings; the enhanced feature embeddings comprise an enhanced character feature embedding, an enhanced grapheme feature embedding and an enhanced phonetic feature embedding;

[0034] a fusion weight embedding module configured to call a gating selection function to determine the fusion weight of each of the enhanced character feature embedding, the enhanced grapheme feature embedding and the enhanced phonetic feature embedding;

[0035] a recognition module configured to input the enhanced feature embeddings and the corresponding fusion weights into a sequence encoding layer to obtain sequence encoding, and to perform label decoding on the sequence encoding using a conditional random field to obtain a named entity recognition result.

[0036] The application also provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of the method described above.

[0037] The application also provides an electronic device comprising a memory and a processor, the memory having a computer program stored therein, and the processor realizing the steps of the method as described above when invoking the computer program in the memory.

[0038] The application also provides a computer program product comprising a computer program which, when executed, realizes the steps of the method as described above.

[0039] The application provides a Chinese named entity recognition method, comprising: obtaining to-be-recognized Chinese data; performing feature embedding on the to-be-recognized Chinese data to obtain Chinese character semantic information; the Chinese character semantic information comprises character embedding representation vectors, font embedding representation vectors and phonetic embedding representation vectors; input parameters of an attention mechanism are obtained according to the character embedding representation vectors, the font embedding representation vectors and the phonetic embedding representation vectors and respective corresponding learnable parameter matrices; cross fusion is performed according to the input parameters to obtain enhanced feature embedding; the enhanced feature embedding comprises enhanced character feature embedding, enhanced font feature embedding and enhanced phonetic feature embedding; a gating selection function is invoked to determine respective fusion weights of the enhanced character feature embedding, the enhanced font feature embedding and the enhanced phonetic feature embedding; the enhanced feature embedding and the corresponding fusion weights are input into a sequence encoding layer to obtain sequence encoding, and the sequence encoding is decoded by using a conditional random field to obtain a named entity recognition result.

[0040] The application significantly improves the robustness and accuracy of a Chinese named entity recognition system under complex contexts by introducing multi-dimensional semantic feature embedding and a dynamic weight fusion mechanism. The visual structure information carried by character forms, the phonetic association features contained in phonetics and character semantic vectors are deeply coupled to form a trinity Chinese character semantic expression system. In the feature fusion stage, the cross perception and dynamic enhancement of font, phonetic and character heterogeneous features are realized through the attention mechanism constructed by the learnable parameter matrix, which can autonomously capture the semantic differences of homophonic characters with different forms or identify the entity boundary changes caused by multi-sound characters. The introduction of the gating selection function solves the semantic dilution problem caused by static feature weight allocation in traditional methods, effectively suppresses the interference of multi-sound characters by simulating the selective attention process in human brain cognition. At the sequence encoding level, the combination of enhanced feature embedding and conditional random field significantly improves the entity boundary ambiguity problem. For the common nested entity phenomenon in Chinese text, the enhanced font features and phonetic features are fused, so that the conditional random field can rely on the strengthened semantic association during decoding, and the recognition of entities is more accurate. At the same time, by fusing multiple information sources to complement each other, ambiguity can be effectively reduced, and the accuracy and robustness of recognition can be improved.

[0041] The application further provides a Chinese named entity recognition system, a computer readable storage medium, an electronic device and a computer program product, which have the above beneficial effects, and details are not repeated here. BRIEF DESCRIPTION OF DRAWINGS

[0042] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings needed to be used in the embodiments or prior art description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor on the basis of the provided drawings.

[0043] Figure 1 A flowchart of a Chinese named entity recognition method provided by an embodiment of the present application;

[0044] Figure 2 A structural schematic diagram of a Chinese named entity recognition system provided by an embodiment of the present application;

[0045] Figure 3 A structural diagram of an electronic device provided by an embodiment of the present application. DETAILED DESCRIPTION

[0046] In order to make the purposes, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are some of the embodiments of the present application, not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor fall within the scope of protection of the present application.

[0047] Reference Figure 1 , Figure 1 A flowchart of a Chinese named entity recognition method provided by an embodiment of the present application, the method comprising:

[0048] S101: acquiring Chinese data to be recognized;

[0049] S102: performing feature embedding on the Chinese data to be recognized to obtain Chinese character semantic information; the Chinese character semantic information comprises character embedding representation vectors, font embedding representation vectors and phonetic embedding representation vectors;

[0050] S103: obtaining input parameters of an attention mechanism according to the character embedding representation vectors, the font embedding representation vectors and the phonetic embedding representation vectors, and respective corresponding learnable parameter matrices;

[0051] S104: cross-fusion is performed according to the input parameters to obtain an enhanced feature embedding; the enhanced feature embedding includes an enhanced character feature embedding, an enhanced grapheme feature embedding, and an enhanced phonetic feature embedding;

[0052] S105: a gating selection function is called to determine the fusion weight of each of the enhanced character feature embedding, the enhanced grapheme feature embedding, and the enhanced phonetic feature embedding;

[0053] S106: the enhanced feature embedding and the corresponding fusion weight thereof are input into a sequence encoding layer to obtain sequence encoding, and the sequence encoding is label-decoded by using a conditional random field to obtain a named entity recognition result.

[0054] After obtaining the to-be-recognized Chinese data, feature embedding needs to be performed, and feature embedding is performed for characters, graphemes, and phonetics respectively. Specifically, character feature recognition can be performed on the to-be-recognized Chinese data to obtain a character embedding representation vector, grapheme feature recognition can be performed on the to-be-recognized Chinese data to obtain a grapheme embedding representation vector, and phonetic feature recognition can be performed on the to-be-recognized Chinese data to obtain a phonetic embedding representation vector. The following further describes the three feature embedding processes:

[0055] For characters, a pre-trained language model is called to map each character in the to-be-recognized Chinese data to a fixed-dimensional vector representation with reference to a character embedding lookup table, to obtain the character embedding representation vector.

[0056] In the field of Chinese named entity recognition, large models such as BERT (Bidirectional Encoder Representations from Transformers, a pre-trained language model based on the Transformer architecture) pre-training model based on the Transformer architecture have achieved unexpected success. Therefore, BERT can be used as a character embedding method in the model. BERT will map each character to a fixed-dimensional vector representation. Specifically, for each group of characters , the corresponding character embedding can be obtained in the following manner: , wherein represents a character embedding lookup table. After BERT processing, the following representation can be obtained: , wherein , represents the dimension of the character embedding vector.

[0057] For glyphs, open-source character images can be obtained and uniformly converted into grayscale images of a set size. These grayscale images are then stacked into a three-dimensional tensor. The three-dimensional tensor includes the number of image channels and the length and width of the grayscale images, with the number of characters in the sentence added as tensor parameters. This three-dimensional tensor is then input into a convolutional layer. Finally, the multi-channel image is sequentially subjected to two-dimensional convolution and two-dimensional pooling to extract the glyph embedding representation vector. The convolutional layer contains two three-dimensional convolutions used to convert a one-channel grayscale image into a multi-channel image.

[0058] In one exemplary application, for glyph embedding, character images can be collected from an open-source dictionary and converted into 50×50 grayscale images using the PIL (Python Imaging Library) library in Python. These character images are then stacked into a three-dimensional tensor. The expression (L) represents the number of characters in the sentence, height represents the height, width represents the width, and channel represents the number of image channels, which are used as input to the convolutional layer. The convolutional layer consists of two 3D convolutions, which convert a 1-channel grayscale image into an 8-channel image with various features and contextual information. The 3D convolution is designed to extract features between each frame of a video image, and each Chinese character in a text sentence can be considered as a frame image; therefore, 3D convolution can be used to extract glyph vectors with contextual glyph information. Simultaneously, padding is used to maintain the consistency of the image sequence's dimensionality. The output of the 3D convolution is then further compressed through a series of convolutional pooling operations, including 2D convolution and 2D max pooling, to extract deeper glyph features. Through these operations, a 50×50 grayscale image of a character is successfully compressed into a 2×2 grid structure with 64 channels. To filter noise, the maximum value in the 2×2 structure is selected as the final glyph vector of the character, ultimately obtaining the embedded representation of the glyph features. ,in This represents the dimension of the glyph embedding vector.

[0059] For phonetic representation, the Chinese data to be identified can be converted into a corresponding pinyin sequence; each Chinese character corresponds to a text pinyin information; the text pinyin information is represented by a Roman letter sequence and includes diacritics to represent the first, second, third, fourth, and neutral tones respectively. Finally, local features of the pinyin sequence are extracted and sequentially passed through a multi-head attention layer, a residual connection layer, and a normalization layer to obtain a glyph embedding representation vector; the multi-head attention layer is used to capture the global long-range dependency of the text pinyin information.

[0060] In an exemplary application process, a ready-made open source NLP (Natural Language Processing) tool Pypinyin library is used to convert the character sequence into a phonetic sequence. Pypinyin is a Python Pinyin library that can convert Chinese characters into their corresponding Pinyin, supports multi-phonetic characters, and provides multiple conversion methods. The Pinyin of Chinese characters is represented by a sequence of Roman letters, with four tone marks to represent tones, and numbers 0, 1, 2, 3 and 4 are used to represent different tones, where 0 represents light tone, 1 represents Yin Ping, 2 represents Yang Ping, 3 represents Shangsheng, and 4 represents Qusheng. These tones are added to the end of the Roman character sequence, while the input Pinyin sequence of each character is specified as a fixed length of 8. When the actual length of the Pinyin sequence is less than 8, the remaining spaces are filled with a special character "-". Then, a CNN is used to extract local features of the phonetic sequence, and a multi-head attention layer is added on this basis to capture the global long-distance dependence of the text Pinyin information. Finally, an additional layer of residual connection (Add) and layer normalization (Norm) is added so that the network can learn new features while not completely ignoring the original information, which helps the model to better learn the mapping relationship between the input and the output, and also alleviates the problem of gradient disappearance.

[0061] The corresponding Pinyin vector can be obtained in the following form:

[0062] ;

[0063] wherein represents the Pypinyin library processing process, is the Pinyin embedding vector extracted by the CNN (Convolutional Neural Network) with a width of 2. The input is fed into the multi-head attention mechanism module to extract global features, and the calculation process is as follows:

[0064] First, linear transformation is performed on the obtained Pinyin embedding to obtain Query (Query), Key (Key) and Value (Value):

[0065] ;

[0066] ;

[0067] ;

[0068] wherein , and are learnable weight matrices, , and is the bias term. Then, the attention score is calculated as follows:

[0069] ;

[0070] wherein denotes the dimension of the input pinyin embedding vector. With multi-head attention, the semantic representation ability of pinyin can be enhanced, and each attention head can learn different types of semantic relationships and feature information in parallel. The pinyin embedding is linearly transformed by different parameter matrices to obtain h (the number of attention heads) groups of Q, K, and V, and then the attention score of each head is calculated:

[0071] ;

[0072] Finally, all the attention scores are concatenated to obtain the final pinyin embedding vector:

[0073] ;

[0074] wherein , denotes the dimension of the pinyin embedding vector.

[0075] When cross-fusion is performed, after the feature embedding layer, the character embedding representation vector ( ), the glyph embedding representation vector , and the phonetic embedding representation vector are obtained. Each type of feature embedding representation vector has its unique representation meaning, and it is both complementary and different from each other. Therefore, three different Cross-Transformers (cross-modal Transformers) are used to cross each other between characters, words, and pinyin information to integrate them together, i.e., concatenating the enhanced character feature embedding, the enhanced glyph feature embedding, and the enhanced phonetic feature embedding, to obtain the gated total input.

[0076] The gated input is then written to a three-way selector, which outputs the corresponding gating values of the character, pinyin, and semantic three channels; wherein the three-way selector includes three linear selectors with independently set learnable parameters. The gating values are used as coefficients to weight and sum the enhanced character feature embedding, the enhanced glyph feature embedding, and the enhanced phonetic feature embedding, to obtain the fused features.

[0077] The three input parameters , , of the attention mechanism are obtained by multiplying the character feature embedding, the pinyin feature embedding, and the glyph feature embedding by different learnable parameter matrices.

[0078] ;

[0079] where each W is a learnable parameter, and I is an identity matrix. The attention score is computed in Cross-Transformer as follows:

[0080] .

[0081] After the three Cross-Transformers, we obtain two enhanced character feature embeddings, two enhanced grapheme feature embeddings, and two enhanced phonetic feature embeddings. We concatenate them into two fused feature vectors, respectively 、 、 , and then proceed to the next step.

[0082] By designing a gating selection mechanism, we can automatically select and adjust the fusion weights of each feature information between different features according to the task requirements. The gating selection mechanism can dynamically adjust the weights and importance of each modality according to the input features of the current task, ensuring that irrelevant modality information is suppressed while enhancing the integration of key modality information, thereby improving the accuracy and efficiency of multi-modal information fusion.

[0083] First, we design a selective gate unit for each representation level, which can control the amount of information used in the final representation. For example, if the current text is more colloquial, more information from the pinyin attention will flow into the mixed representation. In this way, the model not only learns the correlation between modalities better, but also adjusts the fusion strategy adaptively according to the specific context information, effectively improving the performance in the NER (Named Entity Recognition) task. The specific calculation process is as follows:

[0084] ;

[0085] ;

[0086] ;

[0087] ;

[0088] where is the Sigmoid function, 、 、 、 、 are learnable parameters, denotes the concatenation of vectors. Finally, all features are fused into .

[0089] Through the gating mechanism, the model automatically reduces the weight of the character pronunciation in the "high confidence character shape scene", and automatically increases the weight of the character pronunciation and character shape in the multi-pronunciation character or OCR ambiguous scene, thereby significantly reducing the manual parameter tuning cost, and improving the robustness and interpretability of the system in different text sources and different noise environments.

[0090] In step S106, the enhanced feature embedding and its corresponding fusion weight are input into the sequence encoding layer to obtain sequence encoding, and the sequence encoding is decoded by using a conditional random field to obtain a named entity recognition result. The main task of the sequence encoding layer is to capture the context information and semantic relationship in the input sequence, so as to better understand and recognize the named entity. First, the fused feature vector h is taken as the input of the sequence encoding layer, and then the sequence encoding H is obtained.

[0091] The sequence encoding layer can use CNN, BiLSTM (Bidirectional Long Short-Term Memory), Transformer and other models. In the model disclosed in the present application, BiLSTM can be selected for sequence modeling. The BiLSTM model is composed of forward and backward LSTM units, which can obtain forward and backward context vectors of characters at the same time. The LSTM unit controls the transmission of information through three specially designed gates, so as to better capture the long-term dependence in the sequence. After the input sequence passes through the embedding layer, the model inputs the character sequence in which multiple features have been fused into the forward and backward LSTM respectively, calculates the forward vector and the backward vector, and then connects the two vectors as the output of the hidden layer, which is implemented as follows:

[0092] .

[0093] wherein, and respectively represent the output of the LSTM at the previous time, represents a vector splicing operation.

[0094] Finally, the conditional random field (CRF) is used for label decoding to obtain the final named entity recognition result. After CRF decoding, a first-order Viterbi algorithm is used to find the most possible label sequence of the sentence. Given N labeled data The entire model is trained by minimizing the following negative log-likelihood function:

[0095] .

[0096] In an implementable embodiment, the decoded output BMES (Beginning, Middle, End, Single, a kind of annotation in named entity recognition, used to annotate entities in text) or BIO (Beginning, Inside, Outside, a kind of annotation in named entity recognition) label sequence can be automatically restored to entity start and end offset, entity type, confidence; support callback user-defined dictionary for correction, or access business rules to filter invalid entities; at the same time, JSON, XML, CoNLL and other formats are provided for back writing, which is convenient for connecting with downstream systems such as search engines, knowledge graphs and approval flows.

[0097] This step converts the fused multi-modal features into a legal and globally optimal named entity label sequence through the above multi-dimensional coding and CRF decoding strategy. The final output recognition result has high precision, high legality rate and high interpretability.

[0098] The present application introduces multi-dimensional semantic feature embedding and dynamic weight fusion mechanism, which significantly improves the robustness and accuracy of the Chinese named entity recognition system in complex context. The visual structure information carried by the character form, the phonetic association features contained in the character sound and the character semantic vector are deeply coupled to form a trinity Chinese character semantic expression system. In the feature fusion stage, through the attention mechanism constructed by the learnable parameter matrix, cross perception and dynamic enhancement of the three types of heterogeneous features of character form, character sound and character are realized, which can automatically capture the semantic difference of homophonic characters or identify the entity boundary change caused by multi-sound characters. The introduction of the gating selection function solves the problem of semantic dilution caused by static feature weight allocation in traditional methods. By simulating the selective attention process in human brain cognition, the interference of multi-sound characters is effectively suppressed. At the sequence encoding level, the combination of enhanced feature embedding and conditional random field significantly improves the entity boundary ambiguity problem. For the common nested entity phenomenon in Chinese text, by fusing the enhanced character form features and phonetic features, the conditional random field can identify the entity more accurately according to the strengthened semantic association during decoding, and by fusing multiple information sources to complement each other, it can effectively reduce ambiguity and improve the accuracy and robustness of recognition.

[0099] Referring to Figure 2 , Figure 2 A Chinese named entity recognition system structure diagram provided by an embodiment of the present application, the system comprises:

[0100] A data acquisition module for acquiring Chinese data to be recognized;

[0101] a feature embedding module configured to perform feature embedding on the Chinese data to be recognized to obtain Chinese character semantic information, wherein the Chinese character semantic information comprises a character embedding representation vector, a grapheme embedding representation vector, and a phoneme embedding representation vector;

[0102] a parameter generation module configured to obtain input parameters of an attention mechanism according to the character embedding representation vector, the grapheme embedding representation vector, and the phoneme embedding representation vector, and respective learnable parameter matrices corresponding to the character embedding representation vector, the grapheme embedding representation vector, and the phoneme embedding representation vector;

[0103] a feature fusion module configured to perform cross fusion according to the input parameters to obtain enhanced feature embeddings, wherein the enhanced feature embeddings comprise enhanced character feature embeddings, enhanced grapheme feature embeddings, and enhanced phoneme feature embeddings;

[0104] a fusion weight embedding module configured to determine respective fusion weights of the enhanced character feature embeddings, the enhanced grapheme feature embeddings, and the enhanced phoneme feature embeddings by invoking a gating selection function;

[0105] a recognition module configured to input the enhanced feature embeddings and respective fusion weights thereof into a sequence encoding layer to obtain sequence encodings, and to perform label decoding on the sequence encodings by using a conditional random field to obtain a named entity recognition result.

[0106] Based on the above embodiment, as a preferred embodiment, the feature embedding module comprises:

[0107] a character recognition unit configured to perform character feature recognition on the Chinese data to be recognized to obtain the character embedding representation vector;

[0108] a grapheme recognition unit configured to perform grapheme feature recognition on the Chinese data to be recognized to obtain the grapheme embedding representation vector;

[0109] a phoneme recognition unit configured to perform phoneme feature recognition on the Chinese data to be recognized to obtain the phoneme embedding representation vector.

[0110] Based on the above embodiment, as a preferred embodiment, the character recognition unit is a unit configured to invoke a pre-trained language model to map each character in the Chinese data to be recognized to a fixed-dimension vector representation by referring to a character embedding lookup table to obtain the character embedding representation vector.

[0111] Based on the above embodiment, as a preferred embodiment, the grapheme recognition unit is a unit configured to perform the following steps:

[0112] obtain an open-source character image;

[0113] The open source character image is uniformly converted into a set size gray image, and the gray image is stacked into a three-dimensional tensor; the three-dimensional tensor includes the number of image channels and the length and width of the gray image, and adds the number of sentence characters as a tensor parameter;

[0114] The three-dimensional tensor is input into a convolution layer; the convolution layer includes two three-dimensional convolutions for converting a 1-channel gray image into a multi-channel image;

[0115] The multi-channel image is sequentially subjected to two-dimensional convolution and two-dimensional pooling to obtain the glyph embedding representation vector.

[0116] Based on the above embodiment, as a preferred embodiment, the word pronunciation recognition unit is a unit for performing the following steps:

[0117] The Chinese data to be recognized is converted into a corresponding pinyin sequence; wherein each Chinese character corresponds to a text pinyin information; the text pinyin information is represented by a sequence of Roman letters and includes tone marks for representing Yin Ping, Yang Ping, Shangsheng, Quesheng and Qingsheng respectively;

[0118] Local features of the pinyin sequence are extracted, and a multi-head attention layer, a residual connection layer and a normalization layer are sequentially passed to obtain a glyph embedding representation vector; the multi-head attention layer is used to capture global long-distance dependencies of the text pinyin information.

[0119] Based on the above embodiment, as a preferred embodiment, the fusion weight embedding module includes:

[0120] A feature splicing unit is configured to splice the enhanced character feature embedding, the enhanced glyph feature embedding and the enhanced word pronunciation feature embedding to obtain a total input of the gate;

[0121] A gate value calculation unit is configured to write the gate input into a three-way selector to output the gate values corresponding to the character, pinyin and semantic three channels respectively; wherein the three-way selector includes a linear selector with three independent sets of learnable parameters;

[0122] A feature fusion unit is configured to weight and sum the enhanced character feature embedding, the enhanced glyph feature embedding and the enhanced word pronunciation feature embedding bit by bit with the gate values as coefficients to obtain a fusion feature.

[0123] The present application also provides a computer readable storage medium and a corresponding embodiment of a computer program product. The computer readable storage medium and the computer program product can store a computer program, which is executed by a processor to implement the steps of the method as described in the above method embodiment.

[0124] It can be understood that if the method in the above embodiment is implemented in the form of a software function unit and sold or used as an independent product, it can be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the present application essentially or the part that contributes to the prior art or the whole or part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium, and performs all or part of the steps of the method described in each embodiment of the present application. The foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (Read-Only Memory, ROM), a random access memory (Random Access Memory, RAM), a magnetic disk or an optical disk, and various media that can store program codes.

[0125] The computer readable storage medium provided in the embodiment includes the method mentioned above, and the effects are the same as above.

[0126] The present application also provides an electronic device, referring to Figure 3 , the structural diagram of an electronic device provided by the embodiment of the present application, as shown in Figure 3 , can include a processor 1410 and a memory 1420.

[0127] The processor 1410 can include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 1410 can be implemented in at least one hardware form of a DSP (Digital Signal Processing), a FPGA (Field-Programmable Gate Array), and a PLA (Programmable Logic Array). The processor 1410 can also include a main processor and a coprocessor. The main processor is a processor for processing data in an awake state, also known as a CPU (Central Processing Unit). The coprocessor is a low-power processor for processing data in a standby state. In some embodiments, the processor 1410 can be integrated with a GPU (Graphics Processing Unit) that is responsible for rendering and drawing the content to be displayed by the display screen. In some embodiments, the processor 1410 can also include an AI (Artificial Intelligence) processor for processing machine learning-related computing operations.

[0128] The memory 1420 can include one or more computer-readable storage media. The computer-readable storage media can be non-transitory. The memory 1420 can also include high-speed random access memory and can include nonvolatile memory, such as one or more magnetic disk storage devices, optical storage devices, flash memory devices, or other nonvolatile solid-state storage devices. In this embodiment, the memory 1420 is at least used to store the following computer programs 1421, wherein the computer programs are loaded and executed by the processor 1410, and can realize the related steps in the method executed by the electronic device side disclosed in any of the preceding embodiments. In addition, the resources stored in the memory 1420 can also include an operating system 1422, data 1423, and the like, and the storage mode can be temporary storage or permanent storage. The operating system 1422 can include Windows, Linux, Android, and the like.

[0129] In some embodiments, the electronic device can further include a display screen 1430, an input / output interface 1440, a communication interface 1450, a sensor 1460, a power supply 1470, and a communication bus 1480.

[0130] Of course, Figure 3 The structure of the electronic device shown does not constitute a limitation on the electronic device in the embodiments of the present application. In actual applications, the electronic device can include more or fewer components than those shown, or some components can be combined. Figure 3 The structure of the electronic device shown does not constitute a limitation on the electronic device in the embodiments of the present application. In actual applications, the electronic device can include more or fewer components than those shown, or some components can be combined.

[0131] The embodiments in the specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the system provided by the embodiments, since it corresponds to the method provided by the embodiments, the description is relatively simple, and the related parts can be referred to the method part.

[0132] The principles and implementation manners of the present application are described by using specific examples in this paper. The above description of the embodiments is only used to help understand the method and its core idea of the present application. It should be pointed out that for ordinary skilled in the art, without departing from the principles of the present application, some improvements and modifications can be made to the present application, and these improvements and modifications also fall within the protection scope of the present application.

[0133] It also needs to be explained that in the present specification, the relational terms such as first and second and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises", "comprising", or any other variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but can include other elements not expressly listed or inherent to such process, method, article, or apparatus. An element proceeded by "comprises... a" does not, without more constraints, exclude the existence of additional identical elements in the process, method, article, or apparatus that comprises the element.

Claims

1. A method for Chinese named entity recognition, characterized in that, include: Obtain the Chinese data to be recognized; Feature embedding is performed on the Chinese data to be identified to obtain Chinese character semantic information; the Chinese character semantic information includes character embedding representation vector, glyph embedding representation vector and phonetic embedding representation vector. The input parameters of the attention mechanism are obtained based on the character embedding representation vector, the glyph embedding representation vector, and the phonetic embedding representation vector, as well as their respective learnable parameter matrices. The enhanced feature embedding is obtained by cross-fusion based on the input parameters. The enhanced feature embedding includes enhanced character feature embedding, enhanced glyph feature embedding, and enhanced phonetic feature embedding; The gating selection function is invoked to determine the fusion weights of the enhanced character feature embedding, the enhanced glyph feature embedding, and the enhanced phonetic feature embedding. The enhanced feature embedding and its corresponding fusion weights are input into the sequence coding layer to obtain the sequence code, and the sequence code is then labeled using a conditional random field to obtain the named entity recognition result. Specifically, the feature embedding of the Chinese data to be identified to obtain semantic information of Chinese characters includes: The Chinese data to be identified is subjected to character feature recognition to obtain the character embedding representation vector; The character shape feature is identified by performing character shape feature recognition on the Chinese data to be identified, and the character shape embedding representation vector is obtained; The phonetic feature recognition of the Chinese data to be identified is performed to obtain the phonetic embedding representation vector; The character feature recognition of the Chinese data to be identified, to obtain the character embedding representation vector, includes: The pre-trained language model is invoked to map each character in the Chinese data to be recognized to a fixed-dimensional vector representation by referring to the character embedding lookup table, thereby obtaining the character embedding representation vector; Specifically, the character shape feature recognition of the Chinese data to be identified, to obtain the character shape embedding representation vector, includes: Obtain open-source character images; The open-source character images are uniformly converted into grayscale images of a set size, and the grayscale images are stacked into a three-dimensional tensor. The three-dimensional tensor contains the number of image channels and the length and width of the grayscale images, and the number of sentence characters is added as a tensor parameter. The three-dimensional tensor is input into a convolutional layer; the convolutional layer contains two three-dimensional convolutions to convert a 1-channel grayscale image into a multi-channel image; The multi-channel image is sequentially subjected to two-dimensional convolution and two-dimensional pooling to extract the glyph embedding representation vector; Specifically, the phonetic feature recognition of the Chinese data to be identified, to obtain the phonetic embedding representation vector, includes: The Chinese data to be identified is converted into a corresponding pinyin sequence; wherein each Chinese character corresponds to a text pinyin information; the text pinyin information is represented by a Roman letter sequence and includes diacritics used to represent the first tone, second tone, third tone, fourth tone, and neutral tone respectively; Local features of the pinyin sequence are extracted and sequentially passed through a multi-head attention layer, a residual connection layer, and a normalization layer to obtain a glyph embedding representation vector; the multi-head attention layer is used to capture the global long-distance dependency of the pinyin information in the text.

2. The method according to claim 1, characterized in that, The gating selection function is invoked to determine the fusion weights of the enhanced character feature embedding, the enhanced glyph feature embedding, and the enhanced phonetic feature embedding, including: By concatenating the enhanced character feature embedding, the enhanced glyph feature embedding, and the enhanced phonetic feature embedding, the gated total input is obtained; The input from the gating is written into a three-way selector, and the gating values ​​corresponding to the three channels of characters, pinyin, and semantics are output; wherein, the three-way selector includes three linear selectors with independently set learnable parameters; Using the gate value as a coefficient, the enhanced character feature embedding, the enhanced glyph feature embedding, and the enhanced phonetic feature embedding are weighted and summed bit by bit to obtain the fused feature.

3. A Chinese named entity recognition system, characterized in that, include: The data acquisition module is used to acquire the Chinese data to be recognized. The feature embedding module is used to embed features into the Chinese data to be identified to obtain Chinese character semantic information; the Chinese character semantic information includes character embedding representation vector, glyph embedding representation vector and phonetic embedding representation vector. The parameter generation module is used to obtain the input parameters of the attention mechanism based on the character embedding representation vector, the glyph embedding representation vector, and the phonetic embedding representation vector, as well as their respective learnable parameter matrices. The feature fusion module is used to perform cross-fusion based on the input parameters to obtain enhanced feature embeddings. The enhanced feature embedding includes enhanced character feature embedding, enhanced glyph feature embedding, and enhanced phonetic feature embedding; The fusion weight embedding module is used to call the gating selection function to determine the fusion weights of the enhanced character feature embedding, the enhanced glyph feature embedding, and the enhanced phonetic feature embedding. The recognition module is used to input the enhanced feature embedding and its corresponding fusion weight into the sequence coding layer to obtain the sequence code, and to use a conditional random field to perform label decoding on the sequence code to obtain the named entity recognition result; The feature embedding module includes: A character recognition unit, wherein the character recognition unit is a unit used to call a pre-trained language model to map each character in the Chinese data to be recognized to a fixed-dimensional vector representation by referring to a character embedding lookup table, so as to obtain the character embedding representation vector; The character shape recognition unit is used to perform character shape feature recognition on the Chinese data to be recognized, and obtain the character shape embedding representation vector; The phonetic recognition unit is used to perform phonetic feature recognition on the Chinese data to be recognized, and obtain the phonetic embedding representation vector. The character recognition unit is used to perform the following steps: Obtain open-source character images; The open-source character images are uniformly converted into grayscale images of a set size, and the grayscale images are stacked into a three-dimensional tensor. The three-dimensional tensor contains the number of image channels and the length and width of the grayscale images, and the number of sentence characters is added as a tensor parameter. The three-dimensional tensor is input into a convolutional layer; the convolutional layer contains two three-dimensional convolutions to convert a 1-channel grayscale image into a multi-channel image; The multi-channel image is sequentially subjected to two-dimensional convolution and two-dimensional pooling to extract the glyph embedding representation vector; The phonetic recognition unit is used to perform the following steps: The Chinese data to be identified is converted into a corresponding pinyin sequence; wherein each Chinese character corresponds to a text pinyin information; the text pinyin information is represented by a Roman letter sequence and includes diacritics used to represent the first tone, second tone, third tone, fourth tone, and neutral tone respectively; Local features of the pinyin sequence are extracted and sequentially passed through a multi-head attention layer, a residual connection layer, and a normalization layer to obtain a glyph embedding representation vector; the multi-head attention layer is used to capture the global long-distance dependency of the pinyin information in the text.

4. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor for implementing the steps of the method as described in claim 1 or 2 when executing the computer program.

5. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed, implements the steps of the method as described in claim 1 or 2.

6. A computer program product, characterized in that, It includes a computer program that, when executed, implements the steps of the method as described in claim 1 or 2.

Citation Information

Patent Citations

  • Chinese named entity recognition method and device based on multi-view semantic feature fusion

    CN114580416A

  • Method, product, and apparatus for determining the availability of similar identifiers and registering these identifiers across multiple naming systems

    US6901436B1