A Chinese named entity recognition method based on pinyin enhancement
By obtaining the pinyin grid embedding vector and word representation vector, and using the dilated convolutional neural network and MLP predictor to calculate the character fusion features of Chinese text, the problems of fuzzy character boundaries and entity segmentation errors in Chinese named entity recognition are solved, achieving more efficient named entity recognition.
Patent Information
- Application Number
- CN202510788621.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-13
- Publication Date
- 2025-10-10
- Estimated Expiration
- 2045-06-13
AI Technical Summary
Existing Chinese named entity recognition methods based on pinyin enhancement face problems such as fuzzy character boundaries, entity segmentation errors and difficulty in extracting semantic features in Chinese texts, resulting in low recognition performance.
By obtaining the two-dimensional pinyin grid embedding vector and word representation vector of the text to be recognized, a two-dimensional dilated convolutional neural network and an MLP predictor are used to calculate the fusion features and prediction scores between characters, and combined with the Biaffine classifier to improve the accuracy and efficiency of named entity recognition.
It improves the accuracy and efficiency of Chinese named entity recognition, solves the problems of fuzzy character boundaries and entity segmentation errors in Chinese text, and achieves more efficient entity recognition.
Smart Images

Figure CN120317255B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field related to Chinese named entity recognition based on pinyin enhancement, and in particular to a Chinese named entity recognition method based on pinyin enhancement. Background Art
[0002] Chinese named entity recognition based on pinyin enhancement is a basic task in the field of information extraction, and plays an extremely important role in many downstream applications such as information retrieval, entity linking and relationship extraction.
[0003] Currently, most research on Chinese named entity recognition (NER) based on pinyin enhancement focuses on English text. In contrast, NER based on pinyin enhancement faces additional challenges, primarily due to the lack of clear word boundaries (e.g., spaces), insensitivity to uppercase and lowercase letters, the large number of polysyllabic characters, and complex entity structures in Chinese. These characteristics lead to blurred character boundaries, entity segmentation errors, and difficulties in extracting semantic features, significantly increasing the complexity of the task of NER based on pinyin enhancement. Furthermore, current NER methods based on pinyin enhancement primarily achieve entity recognition through text modeling by predicting relationships between characters, which has certain limitations and results in relatively low overall performance of Chinese entity recognition. Summary of the Invention
[0004] This application aims to at least solve the technical problems existing in the prior art. To this end, this application proposes a Chinese named entity recognition method based on pinyin enhancement, which can improve the efficiency and accuracy of Chinese named entity recognition based on pinyin enhancement.
[0005] In a first aspect of the present application, a Chinese named entity recognition method based on pinyin enhancement is provided, comprising the following steps:
[0006] Obtain the two-dimensional pinyin grid embedding vector and word representation vector of the text to be recognized;
[0007] Performing projection based on the word representation vector to obtain a two-dimensional grid feature vector;
[0008] Calculating a fusion feature between every two arbitrary characters of the text to be recognized based on the pinyin grid embedding vector and the two-dimensional grid feature vector;
[0009] Calculate a first corresponding prediction score vector based on the fusion features between each two arbitrary characters;
[0010] Calculating a second corresponding prediction score vector based on the word representation vector;
[0011] Calculating a total prediction score vector based on the first corresponding prediction score vector and the second corresponding prediction score vector;
[0012] The named entity of the to-be-recognized text is output based on the total prediction score vector.
[0013] The control method according to the embodiment of the present application has at least the following beneficial effects:
[0014] This method obtains a two-dimensional pinyin grid embedding vector and a word representation vector of the text to be recognized; performs projection based on the word representation vector to obtain a two-dimensional grid feature vector; calculates the fusion feature between every two arbitrary characters of the text to be recognized based on the pinyin grid embedding vector and the two-dimensional grid feature vector; this application improves the accuracy of Chinese named entity recognition based on pinyin enhancement by fusing the pinyin grid embedding vector and the two-dimensional grid feature vector, calculates the first corresponding prediction score vector based on the fusion feature between every two arbitrary characters; calculates the second corresponding prediction score vector based on the word representation vector; calculates the total prediction score vector based on the first corresponding prediction score vector and the second corresponding prediction score vector; outputs the named entity of the text to be recognized based on the total prediction score vector, thereby improving the efficiency of Chinese named entity recognition based on pinyin enhancement.
[0015] According to some embodiments of the present application, the calculating the fusion feature between every two arbitrary characters of the text to be recognized based on the pinyin grid embedding vector and the two-dimensional grid feature vector includes:
[0016] The semantic grid feature vector is calculated based on the pinyin grid embedding vector, the two-dimensional grid feature vector, the preset area matrix and the preset distance matrix using the following formula:
[0017] ;
[0018] in, is the semantic grid feature vector, is the preset distance matrix, is the preset area matrix, is the pinyin grid embedding vector, For the Characters and The two-dimensional grid feature vector of the characters;
[0019] The semantic grid feature vector is extracted using a two-dimensional dilated convolutional neural network using the following formula to obtain the fusion feature:
[0020] ;
[0021] in, To fusion features, The default dilation rate for 2D dilated convolutional neural networks.
[0022] According to some embodiments of the present application, the calculating the first corresponding prediction score vector based on the fusion features between each two arbitrary characters includes:
[0023] The first corresponding prediction score vector is calculated by the MLP predictor based on the fusion features between each two arbitrary characters using the following formula:
[0024] ;
[0025] in, For the Characters and The first corresponding prediction score vector of characters, For the Characters and The fusion features of the characters.
[0026] According to some embodiments of the present application, calculating the second corresponding prediction score vector based on the word representation vector includes:
[0027] The MLP word representation vector is calculated based on the word representation vector using the following formula:
[0028] ;
[0029] in, For the The MLP word representation vector of characters, For the Character word representation vector, For the The MLP word representation vector of characters, For the Character word representation vector;
[0030] The second corresponding prediction score vector is calculated based on the MLP word representation vector using the Biaffine classifier using the following formula:
[0031] ;
[0032] in, For the Characters and The second corresponding prediction score vector of characters, To preset the first parameter, To preset the second parameter, The third parameter is preset.
[0033] According to some embodiments of the present application, calculating a total prediction score vector based on the first corresponding prediction score vector and the second corresponding prediction score vector includes:
[0034] Calculating a sum of the first corresponding prediction score vector and the second corresponding prediction score vector;
[0035] The sum is taken as the total prediction score vector.
[0036] According to some embodiments of the present application, obtaining a two-dimensional pinyin grid embedding vector and a word representation vector of the text to be recognized includes:
[0037] Perform context modeling on the text to be recognized based on the pre-trained BERT model to obtain a labeled representation;
[0038] Input the labeled representation into BiLSTM to obtain the word representation vector;
[0039] Use the open source PyPinyin package to convert the text to be recognized into a pinyin sequence;
[0040] Perform feature extraction on the pinyin sequence through one-dimensional convolution to obtain a local speech feature vector;
[0041] Performing maximum pooling processing on the local speech feature vector to obtain a pinyin embedding vector;
[0042] The pinyin embedding vector is bidirectionally broadcasted to obtain the two-dimensional pinyin grid embedding vector.
[0043] According to some embodiments of the present application, outputting the named entity of the to-be-recognized text based on the total prediction score vector includes:
[0044] Outputting the corresponding named entity category of every two arbitrary characters based on the total prediction score vector;
[0045] Deduplication is performed on the corresponding named entities to obtain the named entities of the text to be recognized.
[0046] In a second aspect of the present application, a Chinese named entity recognition system based on pinyin enhancement is provided. The Chinese named entity recognition system based on pinyin enhancement includes:
[0047] A data acquisition module is used to obtain the two-dimensional pinyin grid embedding vector and word representation vector of the text to be recognized;
[0048] A projection module, configured to perform projection based on the word representation vector to obtain a two-dimensional grid feature vector;
[0049] a fusion feature calculation module, configured to calculate a fusion feature between every two arbitrary characters of the text to be recognized based on the pinyin grid embedding vector and the two-dimensional grid feature vector;
[0050] A first corresponding prediction score vector calculation module, configured to calculate a first corresponding prediction score vector based on the fusion features between each two arbitrary characters;
[0051] A second corresponding prediction score vector calculation module, configured to calculate a second corresponding prediction score vector based on the word representation vector;
[0052] a total prediction score vector calculation module, configured to calculate a total prediction score vector based on the first corresponding prediction score vector and the second corresponding prediction score vector;
[0053] A named entity output module is used to output the named entity of the text to be recognized based on the total prediction score vector.
[0054] This system obtains the two-dimensional pinyin grid embedding vector and word representation vector of the text to be recognized; performs projection based on the word representation vector to obtain a two-dimensional grid feature vector; calculates the fusion feature between every two arbitrary characters of the text to be recognized based on the pinyin grid embedding vector and the two-dimensional grid feature vector; this application improves the accuracy of Chinese named entity recognition based on pinyin enhancement by fusing the pinyin grid embedding vector and the two-dimensional grid feature vector, calculates the first corresponding prediction score vector based on the fusion feature between every two arbitrary characters; calculates the second corresponding prediction score vector based on the word representation vector; calculates the total prediction score vector based on the first corresponding prediction score vector and the second corresponding prediction score vector; outputs the named entity of the text to be recognized based on the total prediction score vector, thereby improving the efficiency of Chinese named entity recognition based on pinyin enhancement.
[0055] The third aspect of the present application provides an electronic device for Chinese named entity recognition based on pinyin enhancement, comprising at least one control processor and a memory for communicating with the at least one control processor; the memory stores instructions that can be executed by the at least one control processor, and the instructions are executed by the at least one control processor to enable the at least one control processor to execute the above-mentioned Chinese named entity recognition method based on pinyin enhancement.
[0056] In a fourth aspect of the present application, a computer-readable storage medium is provided, which stores computer-executable instructions, and the computer-executable instructions are used to enable a computer to execute the above-mentioned Chinese named entity recognition method based on pinyin enhancement.
[0057] It should be noted that the beneficial effects between the second to fourth aspects of this application and the prior art are the same as the beneficial effects between the above-mentioned Chinese named entity recognition system based on pinyin enhancement and the prior art, and will not be described in detail here.
[0058] Additional aspects and advantages of the present application will be given in part in the description below, and in part will become obvious from the description below, or will be learned through practice of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0059] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the description of the embodiments in conjunction with the following drawings, in which:
[0060] Figure 1 This is a flowchart of a Chinese named entity recognition method based on pinyin enhancement according to an embodiment of the present application;
[0061] Figure 2 1 is a schematic diagram of the structure of an embodiment of a Chinese named entity recognition system based on pinyin enhancement provided by the present application;
[0062] Figure 3 It is a structural diagram of an embodiment of the electronic device provided by this application. DETAILED DESCRIPTION
[0063] The following describes in detail embodiments of the present application. Examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present application and are not to be construed as limiting the present application.
[0064] In the description of this application, if there is a description of first, second, etc., it is only for the purpose of distinguishing technical features, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features or implicitly indicating the order of the indicated technical features.
[0065] In the description of this application, it should be understood that descriptions involving orientation, such as the orientation or positional relationship indicated by up, down, etc., are based on the orientation or positional relationship shown in the accompanying drawings, and are only for the convenience of describing this application and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation on this application.
[0066] In the description of this application, it should be noted that, unless otherwise clearly defined, terms such as setting, installing, and connecting should be understood in a broad sense, and technical personnel in the relevant technical field can reasonably determine the specific meaning of the above terms in this application based on the specific content of the technical solution.
[0067] Chinese named entity recognition based on pinyin enhancement is a basic task in the field of information extraction, and plays an extremely important role in many downstream applications such as information retrieval, entity linking and relationship extraction.
[0068] Currently, most research on Chinese named entity recognition (NER) based on pinyin enhancement focuses on English text. In contrast, NER based on pinyin enhancement faces additional challenges, primarily due to the lack of clear word boundaries (e.g., spaces), insensitivity to uppercase and lowercase letters, the large number of polysyllabic characters, and complex entity structures in Chinese. These characteristics lead to blurred character boundaries, entity segmentation errors, and difficulties in extracting semantic features, significantly increasing the complexity of the task of NER based on pinyin enhancement. Furthermore, current NER methods based on pinyin enhancement primarily achieve entity recognition through text modeling by predicting relationships between characters, which has certain limitations and results in relatively low overall performance of Chinese entity recognition.
[0069] In order to solve the above technical defects, an embodiment of the present application provides a Chinese named entity recognition method based on pinyin enhancement.
[0070] See Figure 1 , is a flowchart of a Chinese named entity recognition method based on pinyin enhancement provided by an embodiment of the present application, the method is applied to an electronic device, which may be a server, etc. Figure 1 As shown, the Chinese named entity recognition method based on pinyin enhancement includes:
[0071] Step S101, obtaining a two-dimensional pinyin grid embedding vector and a word representation vector of the text to be recognized;
[0072] Step S102: Projecting based on the word representation vector to obtain a two-dimensional grid feature vector;
[0073] Step S103: Calculate the fusion feature between every two arbitrary characters of the text to be recognized based on the pinyin grid embedding vector and the two-dimensional grid feature vector;
[0074] Step S104: Calculate a first corresponding prediction score vector based on the fusion features between every two arbitrary characters;
[0075] Step S105: Calculate a second corresponding prediction score vector based on the word representation vector;
[0076] Step S106: Calculate a total prediction score vector based on the first corresponding prediction score vector and the second corresponding prediction score vector;
[0077] Step S107: Output the named entity of the text to be recognized based on the total prediction score vector.
[0078] This method obtains a two-dimensional pinyin grid embedding vector and a word representation vector of the text to be recognized; performs projection based on the word representation vector to obtain a two-dimensional grid feature vector; calculates the fusion feature between every two arbitrary characters of the text to be recognized based on the pinyin grid embedding vector and the two-dimensional grid feature vector; this application improves the accuracy of Chinese named entity recognition based on pinyin enhancement by fusing the pinyin grid embedding vector and the two-dimensional grid feature vector, calculates the first corresponding prediction score vector based on the fusion feature between every two arbitrary characters; calculates the second corresponding prediction score vector based on the word representation vector; calculates the total prediction score vector based on the first corresponding prediction score vector and the second corresponding prediction score vector; outputs the named entity of the text to be recognized based on the total prediction score vector, thereby improving the efficiency of Chinese named entity recognition based on pinyin enhancement.
[0079] In some embodiments, calculating a fusion feature between every two arbitrary characters of the text to be recognized based on the pinyin grid embedding vector and the two-dimensional grid feature vector includes:
[0080] The semantic grid feature vector is calculated based on the pinyin grid embedding vector, the two-dimensional grid feature vector, the preset area matrix and the preset distance matrix using the following formula:
[0081] ;
[0082] in, is the semantic grid feature vector, is the preset distance matrix, is the preset area matrix, is the pinyin grid embedding vector, For the Characters and The two-dimensional grid feature vector of the characters;
[0083] The semantic grid feature vector is extracted using the two-dimensional dilated convolutional neural network using the following formula to obtain the fusion feature:
[0084] ;
[0085] in, To fusion features, The default dilation rate for 2D dilated convolutional neural networks.
[0086] Specifically, this application uses conditional layer normalization to project the word representation vector into a two-dimensional grid, and generates a two-dimensional grid using the following formula: :
[0087] ;
[0088] in, is the gain parameter, is the bias parameter, is the first weight matrix, is the second weight matrix, is the first deviation vector, is the second deviation vector, is the average value in the standard layer normalization, is the standard deviation in the standard layer normalization.
[0089] This application controls the dilation rate in multi-granularity dilated convolution to capture global interactions across feature grids, avoiding the loss of semantic features caused by simple connections.
[0090] In some embodiments, calculating a first corresponding prediction score vector based on the fusion features between every two arbitrary characters includes:
[0091] Based on the fusion features between every two arbitrary characters, the first corresponding prediction score vector is calculated by the MLP predictor using the following formula:
[0092] ;
[0093] in, For the Characters and The first corresponding prediction score vector of characters, For the Characters and The fusion features of the characters.
[0094] This application calculates the first corresponding prediction score vector to provide a data basis for subsequent calculation of the total score, thereby improving the accuracy of named entity recognition.
[0095] In some embodiments, calculating the second corresponding prediction score vector based on the word representation vector includes:
[0096] The MLP word representation vector is calculated based on the word representation vector using the following formula:
[0097] ;
[0098] in, For the The MLP word representation vector of characters, For the Character word representation vector, For the The MLP word representation vector of characters, For the Character word representation vector;
[0099] Based on the MLP word representation vector, the second corresponding prediction score vector is calculated by the Biaffine classifier using the following formula:
[0100] ;
[0101] in, For the Characters and The second corresponding prediction score vector of characters, To preset the first parameter, To preset the second parameter, The third parameter is preset.
[0102] This application calculates the second corresponding prediction score vector to provide a data basis for subsequent calculation of the total score, thereby improving the accuracy of named entity recognition.
[0103] In some embodiments, calculating the total prediction score vector based on the first corresponding prediction score vector and the second corresponding prediction score vector includes:
[0104] Calculate the sum of the first corresponding prediction score vector and the second corresponding prediction score vector;
[0105] Let and be the total prediction score vector.
[0106] This application provides a data basis for subsequent named entity recognition by calculating the total prediction score vector, thereby improving the accuracy of named entity recognition.
[0107] In some embodiments, obtaining a two-dimensional pinyin grid embedding vector and a word representation vector of the text to be recognized includes:
[0108] Based on the pre-trained BERT model, the context of the text to be recognized is modeled to obtain a labeled representation;
[0109] Input the labeled representation into BiLSTM to obtain the word representation vector;
[0110] Use the open source PyPinyin package to convert the text to be recognized into a pinyin sequence;
[0111] Extract features from the phonetic sequence through one-dimensional convolution to obtain local speech feature vectors;
[0112] Perform maximum pooling on the local speech feature vector to obtain the pinyin embedding vector;
[0113] Perform bidirectional broadcast on the pinyin embedding vector to obtain a two-dimensional pinyin grid embedding vector.
[0114] Specifically, the encoder layer is composed of three parts for a piece of text. First, a pre-trained BERT model performs tokenization and initial context modeling to generate token-level representations. To further enhance contextual understanding, a BiLSTM is applied to generate the final word representation vectors.
[0115] Specifically, in order to effectively utilize the semantic richness of Chinese Pinyin and solve the recognition challenges caused by polyphonic ambiguity, this application extracts and integrates Pinyin information from the input text, and uses the PyPinyin package to convert each Chinese character into a Pinyin sequence consisting of Roman letters and tones, and pads it with "-" to a fixed length of 8 for alignment. For example, the Pinyin sequence length of the Chinese character "太" is 4, where the first three positions represent Pinyin and the last position represents the tone. First, a one-dimensional convolution with a kernel size of 2 is used to extract local speech features, and then Max-Pooling is performed to obtain a Pinyin embedding vector.
[0116] In some embodiments, outputting the named entity of the to-be-recognized text based on the total prediction score vector includes:
[0117] Output the corresponding named entity category for every two arbitrary characters based on the total prediction score vector;
[0118] De-duplicate the corresponding named entities to obtain the named entities of the text to be recognized.
[0119] Specifically, the present application first processes the text at the character level through the encoder layer, performing pinyin and lexical unit processing; then extracts features for each grid through feature fusion, and collaboratively predicts the module to generate an entity feature grid, and finally decodes the entity through the model to complete the recognition.
[0120] Specifically, this application calculates the loss value using the following formula:
[0121] ;
[0122] in, is the loss value, The total number of characters, is the total number of pre-set named entity categories, For the Characters and The true named entity category of characters, For the Characters and The predicted category of the characters;
[0123] When the loss value is greater than the preset value, the recognition model is updated based on the loss value until the loss value is less than or equal to the preset value.
[0124] Specifically, to facilitate understanding by those skilled in the art, a set of best embodiments are provided below:
[0125] 1. Data Acquisition
[0126] Get the two-dimensional pinyin grid embedding vector and word representation vector of the text to be recognized, specifically:
[0127] Based on the pre-trained BERT model, the context of the text to be recognized is modeled to obtain a labeled representation;
[0128] Input the labeled representation into BiLSTM to obtain the word representation vector;
[0129] Use the open source PyPinyin package to convert the text to be recognized into a pinyin sequence;
[0130] Extract features from the phonetic sequence through one-dimensional convolution to obtain local speech feature vectors;
[0131] Perform maximum pooling on the local speech feature vector to obtain the pinyin embedding vector;
[0132] Perform bidirectional broadcast on the pinyin embedding vector to obtain a two-dimensional pinyin grid embedding vector.
[0133] 2. Data Projection
[0134] Projection is performed based on the word representation vector to obtain a two-dimensional grid feature vector.
[0135] 3. Feature Fusion
[0136] The fusion feature between every two arbitrary characters of the text to be recognized is calculated based on the pinyin grid embedding vector and the two-dimensional grid feature vector, specifically:
[0137] The semantic grid feature vector is calculated based on the pinyin grid embedding vector, the two-dimensional grid feature vector, the preset area matrix and the preset distance matrix using the following formula:
[0138] ;
[0139] in, is the semantic grid feature vector, is the preset distance matrix, is the preset area matrix, is the pinyin grid embedding vector, For the Characters and The two-dimensional grid feature vector of the characters;
[0140] The semantic grid feature vector is extracted using the two-dimensional dilated convolutional neural network using the following formula to obtain the fusion feature:
[0141] ;
[0142] in, To fusion features, The default dilation rate for 2D dilated convolutional neural networks.
[0143] 4. Calculation of the first corresponding prediction score vector:
[0144] The first corresponding prediction score vector is calculated based on the fusion features between every two arbitrary characters, specifically:
[0145] Based on the fusion features between every two arbitrary characters, the first corresponding prediction score vector is calculated by the MLP predictor using the following formula:
[0146] ;
[0147] in, For the Characters and The first corresponding prediction score vector of characters, For the Characters and The fusion features of the characters.
[0148] 5. Calculation of the second corresponding prediction score vector:
[0149] The second corresponding prediction score vector is calculated based on the word representation vector, specifically:
[0150] The MLP word representation vector is calculated based on the word representation vector using the following formula:
[0151] ;
[0152] in, For the The MLP word representation vector of characters, For the Character word representation vector, For the The MLP word representation vector of characters, For the Character word representation vector;
[0153] Based on the MLP word representation vector, the second corresponding prediction score vector is calculated by the Biaffine classifier using the following formula:
[0154] ;
[0155] in, For the Characters and The second corresponding prediction score vector of characters, To preset the first parameter, To preset the second parameter, The third parameter is preset.
[0156] 6. Calculation of total prediction score vector:
[0157] The total prediction score vector is calculated based on the first corresponding prediction score vector and the second corresponding prediction score vector, specifically:
[0158] Calculate the sum of the first corresponding prediction score vector and the second corresponding prediction score vector;
[0159] Let and be the total prediction score vector.
[0160] 6. Chinese named entity recognition based on pinyin enhancement:
[0161] Output the named entity of the text to be recognized based on the total prediction score vector.
[0162] Output the corresponding named entity category for every two arbitrary characters based on the total prediction score vector;
[0163] De-duplicate the corresponding named entities to obtain the named entities of the text to be recognized.
[0164] In addition, refer to Figure 2 One embodiment of the present application provides a Chinese named entity recognition system based on pinyin enhancement, including a data acquisition module 1100, a projection module 1200, a fusion feature calculation module 1300, a first corresponding prediction score vector calculation module 1400, a second corresponding prediction score vector calculation module 1500, a total prediction score vector calculation module 1600, and a named entity output module 1700, wherein:
[0165] The data acquisition module 1100 is used to obtain the two-dimensional pinyin grid embedding vector and word representation vector of the text to be recognized;
[0166] The projection module 1200 is used to perform projection based on the word representation vector to obtain a two-dimensional grid feature vector;
[0167] The fusion feature calculation module 1300 is used to calculate the fusion feature between every two arbitrary characters of the text to be recognized based on the pinyin grid embedding vector and the two-dimensional grid feature vector;
[0168] The first corresponding prediction score vector calculation module 1400 is used to calculate the first corresponding prediction score vector based on the fusion features between every two arbitrary characters;
[0169] The second corresponding prediction score vector calculation module 1500 is used to calculate the second corresponding prediction score vector based on the word representation vector;
[0170] The total prediction score vector calculation module 1600 is used to calculate the total prediction score vector based on the first corresponding prediction score vector and the second corresponding prediction score vector;
[0171] The named entity output module 1700 is used to output the named entities of the text to be recognized based on the total prediction score vector.
[0172] This system obtains the two-dimensional pinyin grid embedding vector and word representation vector of the text to be recognized; performs projection based on the word representation vector to obtain a two-dimensional grid feature vector; calculates the fusion feature between every two arbitrary characters of the text to be recognized based on the pinyin grid embedding vector and the two-dimensional grid feature vector; this application improves the accuracy of Chinese named entity recognition based on pinyin enhancement by fusing the pinyin grid embedding vector and the two-dimensional grid feature vector, calculates the first corresponding prediction score vector based on the fusion feature between every two arbitrary characters; calculates the second corresponding prediction score vector based on the word representation vector; calculates the total prediction score vector based on the first corresponding prediction score vector and the second corresponding prediction score vector; outputs the named entity of the text to be recognized based on the total prediction score vector, thereby improving the efficiency of Chinese named entity recognition based on pinyin enhancement.
[0173] It should be noted that this system embodiment and the above-mentioned method embodiment are based on the same inventive concept, so the relevant content of the above-mentioned method embodiment is also applicable to this system embodiment and will not be repeated here.
[0174] Figure 3 A schematic diagram of the hardware structure of Chinese named entity recognition based on pinyin enhancement provided in an embodiment of the present application is shown.
[0175] The Chinese named entity recognition device based on pinyin enhancement may include a processor 301 and a memory 302 storing computer program instructions.
[0176] Specifically, the processor 301 may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiments of the present application.
[0177] Memory 302 may include a large-capacity memory for data or instructions. By way of example and not limitation, memory 302 may include a hard disk drive (HDD), a floppy disk drive, flash memory, an optical disk, a magneto-optical disk, a magnetic tape, or a Universal Serial Bus (USB) drive, or a combination of two or more of these. Where appropriate, memory 302 may include removable or non-removable (or fixed) media. Where appropriate, memory 302 may be internal or external to the integrated gateway disaster recovery device. In a specific embodiment, memory 302 is a non-volatile solid-state memory.
[0178] In some embodiments, the memory 302 may include read-only memory (ROM), random access memory (RAM), magnetic disk storage media devices, optical storage media devices, flash memory devices, electrical, optical, or other physical / tangible memory storage devices. Thus, in general, the memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., memory devices) encoded with software including computer-executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described with reference to the method according to an aspect of the present disclosure.
[0179] The processor 301 reads and executes the computer program instructions stored in the memory 302 to implement any one of the Chinese named entity recognition methods based on pinyin enhancement in the above embodiments.
[0180] In one example, the Chinese named entity recognition device based on pinyin enhancement may further include a communication interface 303 and a bus 310. Figure 3 As shown, the processor 301 , the memory 302 , and the communication interface 303 are connected via a bus 310 and communicate with each other.
[0181] The communication interface 303 is mainly used to implement communication between various modules, devices, units and / or equipment in the embodiments of the present application.
[0182] The bus 310 includes hardware, software, or both, and couples the components of the Chinese named entity recognition device based on pinyin enhancement to each other. By way of example and not limitation, the bus may include an accelerated graphics port (AGP) or other graphics bus, an enhanced industry standard architecture (EISA) bus, a front-side bus (FSB), a HyperTransport (HT) interconnect, an industry standard architecture (ISA) bus, an InfiniBand interconnect, a low pin count (LPC) bus, a memory bus, a microchannel architecture (MCA) bus, a peripheral component interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a serial advanced technology attachment (SATA) bus, a video electronics standard association local (VLB) bus, or other suitable buses or a combination of two or more of these. Where appropriate, the bus 310 may include one or more buses. Although the embodiments of the present application describe and illustrate specific buses, the present application contemplates any suitable bus or interconnect.
[0183] The Chinese named entity recognition device based on pinyin enhancement can execute the Chinese named entity recognition method based on pinyin enhancement in the embodiment of the present application based on the three-dimensional design model, thereby realizing the combination of Figure 1 and Figure 2 The described Chinese named entity recognition method and system based on pinyin enhancement.
[0184] In addition, in conjunction with the Chinese named entity recognition method based on pinyin enhancement in the above embodiments, embodiments of the present application may provide a computer storage medium for implementation. The computer storage medium stores computer program instructions; when the computer program instructions are executed by a processor, any of the Chinese named entity recognition methods based on pinyin enhancement in the above embodiments is implemented.
[0185] It should be understood that the present application is not limited to the specific configurations and processes described above and illustrated in the figures. For the sake of brevity, a detailed description of known methods is omitted here. In the above embodiments, several specific steps are described and illustrated as examples. However, the method process of the present application is not limited to the specific steps described and illustrated. Those skilled in the art can make various changes, modifications, and additions, or change the order of the steps after understanding the spirit of the present application.
[0186] The functional blocks shown in the above block diagrams can be implemented as hardware, software, firmware, or a combination thereof. When implemented in hardware, they can be, for example, electronic circuits, application-specific integrated circuits (ASICs), appropriate firmware, plug-ins, function cards, and the like. When implemented in software, the elements of this application are programs or code segments used to perform the required tasks. Programs or code segments can be stored in a machine-readable medium or transmitted over a transmission medium or communication link via a data signal carried in a carrier wave. "Machine-readable medium" can include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROMs, flash memory, erasable ROMs (EROMs), floppy disks, CD-ROMs, optical disks, hard disks, fiber optic media, radio frequency (RF) links, and the like. Code segments can be downloaded via a computer network such as the Internet or an intranet.
[0187] It should also be noted that the exemplary embodiments mentioned in this application describe some methods or systems based on a series of steps or devices. However, this application is not limited to the order of the above steps. In other words, the steps can be performed in the order mentioned in the embodiments, or in a different order, or several steps can be performed simultaneously.
[0188] Aspects of the present disclosure have been described above with reference to flowcharts and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the present disclosure. It should be understood that each block in the flowcharts and / or block diagrams, as well as combinations of blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device to produce a machine such that execution of these instructions by the processor of the computer or other programmable data processing device enables the implementation of the functions / actions specified in one or more blocks in the flowcharts and / or block diagrams. Such a processor can be, but is not limited to, a general-purpose processor, a special-purpose processor, a special application processor, or a field programmable logic circuit. It should also be understood that each block in the block diagrams and / or flowcharts, as well as combinations of blocks in the block diagrams and / or flowcharts, can also be implemented by dedicated hardware that performs the specified functions or actions, or by a combination of dedicated hardware and computer instructions.
[0189] The above description is only a specific embodiment of the present application. Those skilled in the art will clearly understand that for the convenience and brevity of description, the specific working processes of the systems, modules and units described above can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here. It should be understood that the scope of protection of the present application is not limited thereto. Any person skilled in the art can easily think of various equivalent modifications or replacements within the technical scope disclosed in the present application, and these modifications or replacements should be included in the scope of protection of the present application.
Claims
1. A Chinese named entity recognition method based on pinyin enhancement, characterized in that: The Chinese named entity recognition method based on pinyin enhancement includes: Obtain the two-dimensional pinyin grid embedding vector and word representation vector of the text to be recognized; Performing projection based on the word representation vector to obtain a two-dimensional grid feature vector; Calculating a fusion feature between every two arbitrary characters of the text to be recognized based on the pinyin grid embedding vector and the two-dimensional grid feature vector; Calculate a first corresponding prediction score vector based on the fusion features between each two arbitrary characters; Calculating a second corresponding prediction score vector based on the word representation vector; Calculating a total prediction score vector based on the first corresponding prediction score vector and the second corresponding prediction score vector; The named entity of the to-be-recognized text is output based on the total prediction score vector.
2. A Chinese named entity recognition method based on pinyin enhancement according to claim 1, characterized in that, The calculating the fusion feature between every two arbitrary characters of the text to be recognized based on the pinyin grid embedding vector and the two-dimensional grid feature vector includes: The semantic grid feature vector is calculated based on the pinyin grid embedding vector, the two-dimensional grid feature vector, the preset area matrix and the preset distance matrix using the following formula: ; in, is the semantic grid feature vector, is the preset distance matrix, is the preset area matrix, is the pinyin grid embedding vector, For the Characters and The two-dimensional grid feature vector of the characters; The semantic grid feature vector is extracted using a two-dimensional dilated convolutional neural network using the following formula to obtain the fusion feature: ; in, To fusion features, The default dilation rate for 2D dilated convolutional neural networks.
3. A Chinese named entity recognition method based on pinyin enhancement according to claim 1, characterized in that: The calculating the first corresponding prediction score vector based on the fusion feature between each two arbitrary characters includes: The first corresponding prediction score vector is calculated by the MLP predictor based on the fusion features between each two arbitrary characters using the following formula: ; in, For the Characters and The first corresponding prediction score vector of characters, For the Characters and The fusion features of the characters.
4. A Chinese named entity recognition method based on pinyin enhancement according to claim 1, characterized in that: The calculating a second corresponding prediction score vector based on the word representation vector includes: The MLP word representation vector is calculated based on the word representation vector using the following formula: ; in, For the The MLP word representation vector of characters, For the Character word representation vector, For the The MLP word representation vector of characters, For the Character word representation vector; The second corresponding prediction score vector is calculated based on the MLP word representation vector using the Biaffine classifier using the following formula: ; in, For the Characters and The second corresponding prediction score vector of characters, To preset the first parameter, To preset the second parameter, The third parameter is preset.
5. A Chinese named entity recognition method based on pinyin enhancement according to claim 1, characterized in that: The calculating a total prediction score vector based on the first corresponding prediction score vector and the second corresponding prediction score vector comprises: Calculating a sum of the first corresponding prediction score vector and the second corresponding prediction score vector; The sum is taken as the total prediction score vector.
6. A Chinese named entity recognition method based on pinyin enhancement according to claim 1, characterized in that: The step of obtaining a two-dimensional pinyin grid embedding vector and a word representation vector of the text to be recognized includes: Perform context modeling on the text to be recognized based on the pre-trained BERT model to obtain a labeled representation; Input the labeled representation into BiLSTM to obtain the word representation vector; Use the open source PyPinyin package to convert the text to be recognized into a pinyin sequence; Perform feature extraction on the pinyin sequence through one-dimensional convolution to obtain a local speech feature vector; Performing maximum pooling processing on the local speech feature vector to obtain a pinyin embedding vector; The pinyin embedding vector is bidirectionally broadcasted to obtain the two-dimensional pinyin grid embedding vector.
7. A Chinese named entity recognition method based on pinyin enhancement according to claim 6, characterized in that: Outputting the named entity of the to-be-recognized text based on the total prediction score vector includes: Outputting the corresponding named entity category of every two arbitrary characters based on the total prediction score vector; Deduplication is performed on the corresponding named entities to obtain the named entities of the text to be recognized.
8. A Chinese named entity recognition system based on pinyin enhancement, characterized in that: The Chinese named entity recognition system based on pinyin enhancement includes: A data acquisition module is used to obtain the two-dimensional pinyin grid embedding vector and word representation vector of the text to be recognized; A projection module, configured to perform projection based on the word representation vector to obtain a two-dimensional grid feature vector; a fusion feature calculation module, configured to calculate a fusion feature between every two arbitrary characters of the text to be recognized based on the pinyin grid embedding vector and the two-dimensional grid feature vector; A first corresponding prediction score vector calculation module, configured to calculate a first corresponding prediction score vector based on the fusion features between each two arbitrary characters; A second corresponding prediction score vector calculation module, configured to calculate a second corresponding prediction score vector based on the word representation vector; a total prediction score vector calculation module, configured to calculate a total prediction score vector based on the first corresponding prediction score vector and the second corresponding prediction score vector; A named entity output module is used to output the named entity of the text to be recognized based on the total prediction score vector.
9. A Chinese named entity recognition device based on pinyin enhancement, characterized in that: It includes at least one control processor and a memory for communicating with the at least one control processor; the memory stores instructions that can be executed by the at least one control processor, and the instructions are executed by the at least one control processor to enable the at least one control processor to execute a Chinese named entity recognition method based on pinyin enhancement as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to enable a computer to execute the Chinese named entity recognition method based on pinyin enhancement as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Named entity identification method and apparatus, electronic device and machine-readable storage medium
CN109446521A
Entity information determining method and apparatus, and device
WO2024124913A1