Named Entity Recognition Method, Apparatus and Readable Storage Medium

By using the fusion feature vector processing of pinyin first letters, characters and words in medical electronic medical records, combined with the two-way long and short-term memory network and conditional random field model, the problem of insufficient feature information in medical entity recognition is solved, and the accuracy of recognition is improved.

CN112434520BActive Publication Date: 2025-07-25JIANGXI HUALIAN METAVERSE DIGITAL TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202011257945.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-11-11
Publication Date
2025-07-25
Estimated Expiration
2040-11-11

AI Technical Summary

Technical Problem

In the prior art, in the recognition of named entities in medical electronic medical records, there is a problem that the same entity has multiple representation methods and strong correlation between entities, which increases the difficulty of recognition. Word vectors and word vectors cannot capture comprehensive feature information, and the recognition results after training of BiLSTM+CRF model are not accurate enough.

Method used

The fusion feature vector based on the first letters, characters and words of the pinyin are used to process it through the preset bidirectional long and short-term memory network-conditional random field model, and combined with the convolutional neural network and attention mechanism, the accuracy of medical entity recognition is improved.

Benefits of technology

By fusing the feature vectors of pinyin initial letters, characters and words, more comprehensive feature information can be obtained and the accuracy of medical entity recognition results can be improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112434520B_ABST
    Figure CN112434520B_ABST
Patent Text Reader

Abstract

The present invention provides a named entity recognition method, apparatus and readable storage medium. In the method of the present invention, an electronic medical record to be recognized is input into a named entity recognition model, and a medical entity recognition result corresponding to the electronic medical record to be recognized is output. Among them, the named entity recognition model is obtained after being trained based on electronic medical record sample data and pre-determined medical entity tags. The named entity recognition model is used to process the fusion feature vector of the electronic medical record to be recognized based on the first letter of the pinyin, characters and words by using a preset bidirectional long short-term memory network - conditional random field model, so as to obtain the medical entity recognition result corresponding to the electronic medical record to be recognized. By processing the fusion feature vector of the electronic medical record to be recognized based on the first letter of the pinyin, characters and words by using a preset bidirectional long short-term memory network - conditional random field model, more comprehensive feature information can be obtained, thereby improving the accuracy of the medical entity recognition result.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of information recognition, and particularly to a named entity recognition method, device and readable storage medium. Background Art

[0002] With the development of big data and artificial intelligence, medical electronic medical records have currently been widely applied to the informatization system of hospitals. However, most of the information in the electronic medical records is stored in an unstructured form and cannot be further studied. Therefore, it is particularly important to perform structured processing on the electronic medical records. Named entity recognition of electronic medical records is one of the important methods for performing structured processing on them.

[0003] In the medical field, problems such as multiple Chinese representations for the same medical entity and strong correlations between medical entities increase the difficulty of medical entity recognition. Currently, the word vector or character vector method is commonly used as the model input. Using the character vector as the model input ignores the relationship of mutual connection and mutual representation between characters; using the word vector as the input has the problem that errors caused by word segmentation are further propagated; that is, only through the character vector and the word vector, relatively comprehensive feature information cannot be captured, and problems such as multiple representations of the same entity and strong correlations between entities cannot be fully solved.

[0004] At the same time, for medical entity recognition methods represented by BiLSTM+CRF (Bi-directional Long Short-Term Memory+Conditional Random Field), the features obtained by the training samples passing through the BILSTM model are relatively simple and cannot capture the comprehensive information of the sentence. Using these features for CRF training may result in entity recognition errors, making the recognition results of the trained model inaccurate. Summary of the Invention

[0005] In view of the above technical problems existing in the prior art, the present invention provides a named entity recognition method, device and readable storage medium.

[0006] The present invention provides a named entity recognition method, including:

[0007] Inputting the electronic medical record to be recognized into a named entity recognition model;

[0008] Outputting a medical entity recognition result corresponding to the electronic medical record to be recognized;

[0009] Among them, the named entity recognition model is obtained after being trained based on electronic medical record sample data and pre-determined medical entity tags. The named entity recognition model is used to process the fusion feature vector based on the first letter of the pinyin, characters, and words of the electronic medical record to be recognized by using a preset bidirectional long short-term memory network - conditional random field model, so as to obtain the medical entity recognition result corresponding to the electronic medical record to be recognized.

[0010] According to a named entity recognition method provided by the present invention, the fusion feature vector based on the first letter of the pinyin, characters, and words is obtained by fusing the first letter of the pinyin feature vector, character feature vector, and word feature vector of the electronic medical record to be recognized;

[0011] The preset bidirectional long short-term memory network - conditional random field model includes an input layer, a bidirectional long short-term memory network - convolutional neural network layer, a bidirectional long short-term memory network - attention mechanism layer, and a conditional random field layer connected in sequence. The bidirectional long short-term memory network - convolutional neural network layer includes a bidirectional long short-term memory network model and a convolutional neural network model. The bidirectional long short-term memory network - attention mechanism layer includes a bidirectional long short-term memory network model and an attention mechanism model.

[0012] According to a named entity recognition method provided by the present invention, the process of using the preset bidirectional long short-term memory network - conditional random field model to process the fusion feature vector based on the first letter of the pinyin, characters, and words of the electronic medical record to be recognized to obtain the medical entity recognition result corresponding to the electronic medical record to be recognized specifically includes:

[0013] Input the fusion feature vector into the bidirectional long short-term memory network model in the bidirectional long short-term memory network - convolutional neural network layer to obtain a first vector;

[0014] Input the character feature vector into the convolutional neural network model in the bidirectional long short-term memory network - convolutional neural network layer to obtain a second vector;

[0015] Concatenate and fuse the first vector and the second vector to obtain a third vector;

[0016] Input the third vector into the bidirectional long short-term memory network model and the attention mechanism model in the bidirectional long short-term memory network - attention mechanism layer respectively to obtain a fourth vector output by the bidirectional long short-term memory network model and a fifth vector output by the attention mechanism model;

[0017] Concatenate and fuse the fourth vector and the fifth vector to obtain a sixth vector;

[0018] Input the sixth vector into the conditional random field layer to obtain the medical entity recognition result corresponding to the electronic medical record to be recognized.

[0019] According to a named entity recognition method provided by the present invention, the fusion feature vector of the first letters of pinyin, characters, and words is obtained by fusing the first letter feature vector of pinyin, the character feature vector, and the word feature vector of the electronic medical record to be recognized, specifically including:

[0020] Sum and fuse the first letter feature vector of pinyin and the character feature vector to obtain a seventh vector;

[0021] Concatenate and fuse the seventh vector and the word feature vector to obtain the fusion feature vector.

[0022] According to a named entity recognition method provided by the present invention, the character feature vector and the word feature vector of the electronic medical record to be recognized are obtained based on a word vector model.

[0023] According to a named entity recognition method provided by the present invention, the first letter feature vector of pinyin of the electronic medical record to be recognized is determined based on the electronic medical record to be recognized and a labeled dictionary; the labeled dictionary is composed of medical entities obtained by sequence labeling.

[0024] According to a named entity recognition method provided by the present invention, the second vector is obtained by performing convolution and maximum pooling operations on the character feature vector.

[0025] The present invention also provides a named entity recognition device, including:

[0026] An input module, configured to input an electronic medical record to be recognized into a named entity recognition model;

[0027] An output module, configured to output a medical entity recognition result corresponding to the electronic medical record to be recognized;

[0028] Wherein, the named entity recognition model is obtained by training based on electronic medical record sample data and pre-determined medical entity labels, and the named entity recognition model is used to process the fusion feature vector of the first letters of pinyin, characters, and words of the electronic medical record to be recognized based on a preset bidirectional long short-term memory network - conditional random field model to obtain a medical entity recognition result corresponding to the electronic medical record to be recognized.

[0029] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, and when the processor executes the program, the steps of any one of the above-mentioned named entity recognition methods are implemented.

[0030] The present invention also provides a non-transitory computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of any one of the above-mentioned named entity recognition methods are implemented.

[0031] The named entity recognition method, device and readable storage medium provided by the present invention process the fusion feature vector based on the first letter of pinyin, characters and words of the electronic medical record to be recognized through a preset bidirectional long short-term memory network - conditional random field model, so as to obtain the medical entity recognition result corresponding to the electronic medical record to be recognized, which can obtain more comprehensive feature information and thus improve the accuracy of the medical entity recognition result. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. Obviously, the drawings in the following description are some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.

[0033] Figure 1 is a schematic flowchart of the named entity recognition method provided by the present invention;

[0034] Figure 2 is a schematic structural diagram of the preset bidirectional long short-term memory network - conditional random field model provided by the present invention;

[0035] Figure 3 is a schematic full-process flowchart of the named entity recognition method provided by the present invention;

[0036] Figure 4 is a schematic structural diagram of the named entity recognition device provided by the present invention;

[0037] Figure 5 is a schematic structural diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0038] To make the objectives, technical solutions and advantages of the present invention clearer, the following will clearly and completely describe the technical solutions in the present invention with reference to the drawings in the present invention. Obviously, the described embodiments are some, but not all, of the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art without creative efforts based on the embodiments in the present invention belong to the scope of protection of the present invention.

[0039] The following combines Figures 1 - 5 to describe the named entity recognition method, device and readable storage medium of the present invention.

[0040] Figure 1 is a schematic flowchart of a named entity recognition method provided by the present invention. As Figure 1 shown, the method includes:

[0041] Step 110: Input the electronic medical record to be recognized into the named entity recognition model.

[0042] Specifically, the electronic medical record to be recognized is a Chinese electronic medical record. Before inputting the electronic medical record to be recognized into the named entity recognition model, it needs to be preprocessed. First, extract the text information of the Chinese electronic medical record to be recognized. To protect patient privacy, desensitization processing is also required. As for the method of obtaining the text information, any method in the prior art can be used, and the present invention does not make specific limitations thereon.

[0043] Step 120: Output the medical entity recognition result corresponding to the electronic medical record to be recognized;

[0044] Among them, the named entity recognition model is obtained after being trained based on electronic medical record sample data and predetermined medical entity tags. The named entity recognition model is used to process the fusion feature vector based on the first letter of the pinyin, characters, and words of the electronic medical record to be recognized by using a preset bidirectional long short-term memory network - conditional random field model, so as to obtain the medical entity recognition result corresponding to the electronic medical record to be recognized.

[0045] Specifically, a named entity recognition model can be pre-trained. For example, the named entity recognition model is obtained through the following method: First, collect a large number of sample electronic medical records and determine the medical entity recognition results corresponding to the sample electronic medical records. Then, train an initial model based on the sample electronic medical records and their corresponding medical entity recognition results, so as to obtain the named entity recognition model. During the training process, the data of the Chinese electronic medical records is divided into two parts: a training set and a test set. The BIOES annotation rule is used to uniformly annotate the data of the two parts. The annotated data includes the original Chinese electronic medical records and entity annotations; jieba is used to segment the training data.

[0046] The named entity recognition model is used to process the fusion feature vector based on the first letter of the pinyin, characters, and words of the electronic medical record to be recognized by using a preset bidirectional long short-term memory network - conditional random field (BiLSTM-CRF) model, so as to obtain the medical entity recognition result corresponding to the electronic medical record to be recognized.

[0047] The method provided by the present invention processes the fusion feature vector based on the first letter of the pinyin, characters, and words of the electronic medical record to be recognized by using a preset bidirectional long short-term memory network - conditional random field model, so as to obtain the medical entity recognition result corresponding to the electronic medical record to be recognized, and can obtain more comprehensive feature information, thereby improving the accuracy of the medical entity recognition result.

[0048] Based on the above embodiments, the fused feature vectors of the first letters of pinyin, characters, and words are obtained by fusing the first-letter feature vectors of pinyin, character feature vectors, and word feature vectors of the electronic medical record to be recognized;

[0049] The preset bidirectional long short-term memory network - conditional random field model includes an input layer, a bidirectional long short-term memory network - convolutional neural network layer, a bidirectional long short-term memory network - attention mechanism layer, and a conditional random field layer connected in sequence. The bidirectional long short-term memory network - convolutional neural network layer includes a bidirectional long short-term memory network model and a convolutional neural network model, and the bidirectional long short-term memory network - attention mechanism layer includes a bidirectional long short-term memory network model and an attention mechanism model.

[0050] Specifically, feature extraction is performed on the electronic medical record to be recognized at three granularities: the first letters of Chinese pinyin, characters, and words, to obtain the first-letter feature vectors of pinyin, character feature vectors, and word feature vectors of the electronic medical record to be recognized. Then, the above three vectors are fused to obtain a fused feature vector, which is used as the input of the preset bidirectional long short-term memory network - conditional random field (BiLSTM-CRF) model.

[0051] As Figure 2 shown is the structural schematic diagram of the preset bidirectional long short-term memory network - conditional random field model provided by the present invention. As Figure 2 shown, the preset bidirectional long short-term memory network - conditional random field (BiLSTM-CRF) model includes an input layer, a bidirectional long short-term memory network - convolutional neural network (BiLSTM-CNN) layer, a bidirectional long short-term memory network - attention mechanism (BiLSTM-Attention) layer, and a conditional random field (CRF) layer connected in sequence. The bidirectional long short-term memory network - convolutional neural network (BiLSTM-CNN) layer includes a bidirectional long short-term memory network (BiLSTM) model and a convolutional neural network (CNN) model, and the bidirectional long short-term memory network - attention mechanism (BiLSTM-Attention) layer includes a bidirectional long short-term memory network (BiLSTM) model and an attention mechanism (Attention) model. The CNN model and the Attention mechanism are added to the BiLSTM-CRF model to improve the effect of entity recognition. Among them, adding the CNN layer can more accurately obtain the local information of medical texts, and adding the Attention mechanism can perform weight selection on different words in the sentence, and assign greater weights to important words and phrases.

[0052] The method provided by the present invention performs medical entity recognition on the fusion feature vector of the pinyin initials, characters, and words of the electronic medical record to be recognized through a BiLSTM-CRF model incorporating a CNN model and an Attention mechanism, which can improve the accuracy of the medical entity recognition result while ensuring the comprehensiveness of features.

[0053] Based on the above embodiments, processing the fusion feature vector of the pinyin initials, characters, and words of the electronic medical record to be recognized by the preset bidirectional long short-term memory network - conditional random field model to obtain the medical entity recognition result corresponding to the electronic medical record to be recognized specifically includes:

[0054] Input the fusion feature vector into the bidirectional long short-term memory network model in the bidirectional long short-term memory network - convolutional neural network layer to obtain a first vector;

[0055] Input the character feature vector into the convolutional neural network model in the bidirectional long short-term memory network - convolutional neural network layer to obtain a second vector;

[0056] Concatenate and fuse the first vector and the second vector to obtain a third vector;

[0057] Input the third vector into the bidirectional long short-term memory network model and the attention mechanism model in the bidirectional long short-term memory network - attention mechanism layer respectively to obtain a fourth vector output by the bidirectional long short-term memory network model and a fifth vector output by the attention mechanism model;

[0058] Concatenate and fuse the fourth vector and the fifth vector to obtain a sixth vector;

[0059] Input the sixth vector into the conditional random field layer to obtain the medical entity recognition result corresponding to the electronic medical record to be recognized.

[0060] Specifically, input the fusion feature vector x incorporating the initials feature of Chinese characters into the bidirectional long short-term memory network BiLSTM model to obtain a first vector r; input the character feature vector c into the convolutional neural network CNN model to obtain a second vector c'; concatenate and fuse the first vector r and the second vector c' to form a preliminary semantic vector u representing both the global and local aspects, that is, the third vector; input the third vector u into the BiLSTM model and the Attention model in the BiLSTM-Attention layer respectively to obtain a fourth vector u' output by the BiLSTM model and a fifth vector z output by the Attention model, concatenate and fuse the fourth vector u' and the fifth vector z to obtain a sixth vector e; input the sixth vector e into the CRF layer to predict the optimal sequence, that is, obtain the medical entity recognition result corresponding to the electronic medical record to be recognized.

[0061] The method provided by the present invention inputs the fusion feature vectors of the first letters of the pinyin, characters, and words of the electronic medical record to be recognized into a BiLSTM-CRF model with a CNN model and an Attention mechanism for medical entity recognition, which can improve the accuracy of medical entity recognition results on the basis of ensuring the comprehensiveness of features.

[0062] Based on the above embodiments, the fusion feature vectors of the first letters of the pinyin, characters, and words are obtained by fusing the first-letter feature vectors of the pinyin, character feature vectors, and word feature vectors of the electronic medical record to be recognized, specifically including:

[0063] Sum and fuse the first-letter feature vector of the pinyin and the character feature vector to obtain a seventh vector;

[0064] Concatenate and fuse the seventh vector and the word feature vector to obtain the fusion feature vector.

[0065] Specifically, for the first-letter feature vector of the pinyin a = (a1, a2,..., a m ), the character feature vector c = (c1, c2,..., c n ), and the word feature vector w = (w1, w2,..., w k ), first sum and fuse the first-letter feature vector of the pinyin and the character feature vector to obtain a seventh vector h = (h1, h2,..., h m ) = (c1 + a1, c2 + a2,..., c n + a m ); then concatenate and fuse the seventh vector and the word feature vector to obtain the fusion feature vector x = [h; w] = (x1, x2,..., x t ) = (h1, h2,..., h m , w1, w2,..., w k ), where [·; ·] is the concatenation symbol.

[0066] The method provided by the present invention can obtain more comprehensive feature information through the medical entity recognition results based on the fusion feature vectors of the first letters of the pinyin, characters, and words of the electronic medical record to be recognized, and further improve the accuracy of medical entity recognition results.

[0067] Based on the above embodiments, the character feature vector and the word feature vector of the electronic medical record to be recognized are obtained based on a word vector model.

[0068] Specifically, input the text data of the electronic medical record to be recognized into the word2vec model to generate a character feature vector, and input the segmented text data into the word2vec model to generate a word feature vector.

[0069] The method provided by the present invention obtains the character feature vector and word feature vector of the electronic medical record to be recognized through a word vector model, which can ensure the accuracy of feature extraction and further ensure the accuracy of the medical entity recognition result.

[0070] Based on the above embodiments, the first letter feature vector of the pinyin of the electronic medical record to be recognized is determined based on the electronic medical record to be recognized and an annotation dictionary; the annotation dictionary is composed of medical entities obtained by sequence annotation.

[0071] Specifically, during the training process, a dictionary is formed by numerous medical entities marked with BIOES, and the first letter of each character in the dictionary is extracted. For example, for "cerebral infarction", "ngs" is extracted, and for "myasthenia gravis", "jwl" is extracted, and the pinyin letters that often appear in Chinese electronic medical records are counted. During the actual recognition process, the characters in the Chinese electronic medical record to be recognized are classified according to common letters, and a representation vector is assigned to them, that is, the first letter feature vector of the pinyin.

[0072] The method provided by the present invention can quickly determine the first letter feature vector of the pinyin of the electronic medical record to be recognized based on the electronic medical record to be recognized and the annotation dictionary, improving the efficiency of medical entity recognition.

[0073] Based on the above embodiments, the second vector is obtained by performing convolution and max pooling operations on the character feature vector.

[0074] Specifically, the character feature vector c=(c1, c2,..., c n ) is input into the convolutional neural network CNN model, the size of the convolutional kernel is set, and convolution operations are performed on each character. Then, the feature vectors obtained by each convolutional kernel are subjected to max pooling operations to obtain the vector c'=(c'1, c'2,…, c' n ). Its formula is: q = 1, 2…n. Where, is defined as the vector concatenation symbol, r is the convolution radius, and the max function is the max pooling operation.

[0075] The method provided by the present invention obtains the second vector by performing convolution and max pooling operations on the character feature vector through the CNN model, which can ensure the accuracy of feature extraction and further ensure the accuracy of the medical entity recognition result.

[0076] Figure 3 is the overall process schematic diagram of the named entity recognition method provided by the present invention. The following further explains the method described in any of the above embodiments in combination with Figure 3 :

[0077] Step 1: Obtain the Chinese electronic medical record to be recognized, and preprocess and entity-tag the obtained medical text data;

[0078] Step 1.1: Extract the body information from the obtained Chinese electronic medical record to be recognized. For protecting patient privacy, desensitization processing is also required;

[0079] Step 1.2: Uniformly tag the data of the Chinese electronic medical record to be recognized using the BIOES annotation rule, and segment the data of the Chinese electronic medical record to be recognized using jieba;

[0080] Step 2: Extract features at three granularities of the first letter of Chinese pinyin, characters, and words from the data of the Chinese electronic medical record to be recognized;

[0081] Step 2.1: Classify the characters in the Chinese medical record to be recognized according to common letters, assign a representation vector to them, and initialize it as a 120-dimensional vector. The vector representation is: a = (a1, a2,..., a m ), m = 120;

[0082] Step 2.2: Input the data of the Chinese electronic medical record to be recognized that uses the BIOES annotation rule into the word2vec model to generate a 120-dimensional character vector. The character vector representation is: c = (c1, c2,..., c n ), n = 120;

[0083] Step 2.3: Input the segmented data of the Chinese electronic medical record to be recognized into the word2vec model to generate a 150-dimensional word vector. The word vector representation is: w = (w1, w2,..., w k ), k = 150;

[0084] Step 3: Fuse the features extracted at the three granularities;

[0085] Step 3.1: Fuse the first-letter vector of pinyin and the character vector;

[0086] Add the components in the character vector and the first-letter vector of pinyin item by item to form a new feature vector h = (h1, h2,..., h m ) = (c1 + a1, c2 + a2,..., c n + a m );

[0087] Step 3.2: Fuse the word vector;

[0088] Concatenate the word vector with the new feature vector h to obtain the fused feature vector x that incorporates the initials of Chinese character pinyin, that is, concatenate the new feature vector h with the word vector w to form the fused feature vector x = [h; w] = (x1, x2, …, x t ) = (h1, h2, …, h m , w1, w2, … w k ), where t = 270, and [·; ·] is the concatenation symbol;

[0089] Step 4: Input the fused feature vector into the improved BiLSTM-CRF model;

[0090] Step 4.1: Input the fused feature vector x that incorporates the initials of Chinese character pinyin into the bidirectional long short-term memory network BiLSTM model. In this step, the fused feature vector x = [h; w] = (x1, x2, …, x t ) passes through the bidirectional long short-term memory network to obtain the global context representation r = (r1, r2, …, r t ), where, is the output of the forward long short-term memory network, is the output of the backward long short-term memory network. The forward is calculated as follows:

[0091] i q = σ(w i x q + w i r q-1 + b i )

[0092] f q = σ(w f x q + w f r q-1 + b f )

[0093] o q = σ(w o x q + w o r q-1 + b o )

[0094]

[0095]

[0096]

[0097] Backward The calculation formula is similar to the forward formula, replacing q - 1 with q + 1.

[0098] Step 4.2: Input the word vector c = (c1, c2,..., c n ) into the convolutional neural network CNN model, and the resulting vector is c' = (c'1, c'2,…, c' n ). The formula is: q = 1, 2…n. Among them, is defined as the vector concatenation symbol, r is the convolution radius, and the max function is the max pooling operation.

[0099] Step 4.3: Concatenate r = (r1, r2,…, r t ) output by the BiLSTM model and c' = (c'1, c'2,…, c' n ) output by the CNN model to form a preliminary semantic vector u = [r; c'] = (r1, r2,…, r t , c'1, c'2,…, c' n ) = (u1, u2,…, u m' ), where [·;·] is the concatenation symbol;

[0100] Step 4.4: Input the concatenated vector u in Step 4.3 into another BiLSTM and Attention model. The input vector u = (u1, u2,…, u m' ) passes through the forward and backward LSTM networks to obtain two sets of state output sequences, and the two sets of state output sequences are combined to obtain u' = (u1', u2',…, u m’ ’). Use the Attention model to obtain the parts with greater contribution and weight in the sentence. The formula is: d q = tanh(u q ), where u q is the concatenated vector. Then, calculate the attention weight probability vector through the Softmax function: Finally, calculate the vector after fusing the weight information through weighted summation: Concatenate the Attention vector z and the BiLSTM output vector u' to form the deep semantic representation e = [z; u'] = (e1, e2,...e n' ) of the sentence, where [·;·] is the concatenation symbol;

[0101] Step 4.5: Input the deep semantic representation vector e = (e1, e2,...e n' ) in Step 4.4 into the CRF to predict the optimal sequence. The calculation formula is: y *= arg max Score(e, y'), where y' is the label at this time, L is the transition matrix, and T is the score matrix. Solve for the maximum score Score to obtain the optimal sequence, that is, the medical entity recognition result.

[0102] Based on any of the above embodiments, Figure 4 is a schematic structural diagram of the named entity recognition device provided by the present invention, as Figure 4 shown, the device includes:

[0103] An input module 410, configured to input the electronic medical record to be recognized into the named entity recognition model.

[0104] Specifically, before inputting the electronic medical record to be recognized into the named entity recognition model, it needs to be preprocessed. First, extract the text information of the Chinese electronic medical record to be recognized. To protect patient privacy, desensitization processing is also required. As for the method of obtaining the text information, any method in the prior art can be used, and the present invention does not make specific limitations thereon. After obtaining the text information, it is input into the named entity recognition model through the input module 410.

[0105] An output module 420, configured to output the medical entity recognition result corresponding to the electronic medical record to be recognized;

[0106] Wherein, the named entity recognition model is obtained by training based on electronic medical record sample data and pre-determined medical entity labels, and the named entity recognition model is used to process the fusion feature vector based on the first letter of the pinyin, characters, and words of the electronic medical record to be recognized by using a preset bidirectional long short-term memory network - conditional random field model, so as to obtain the medical entity recognition result corresponding to the electronic medical record to be recognized.

[0107] Specifically, the named entity recognition model is used to process the fusion feature vector based on the first letter of the pinyin, characters, and words of the electronic medical record to be recognized by using a preset bidirectional long short-term memory network - conditional random field (BiLSTM-CRF) model, so as to obtain the medical entity recognition result corresponding to the electronic medical record to be recognized, and output it through the output module 420.

[0108] The device provided by the present invention processes the fusion feature vector based on the first letter of the pinyin, characters, and words of the electronic medical record to be recognized by using a preset bidirectional long short-term memory network - conditional random field model, so as to obtain the medical entity recognition result corresponding to the electronic medical record to be recognized, and can obtain more comprehensive feature information, thereby improving the accuracy of the medical entity recognition result.

[0109] Based on the above embodiment, the fusion feature vector based on the first letter of the pinyin, characters, and words is obtained by fusing the first letter of the pinyin feature vector, character feature vector, and word feature vector of the electronic medical record to be recognized;

[0110] The preset bidirectional long short-term memory network - conditional random field model includes an input layer, a bidirectional long short-term memory network - convolutional neural network layer, a bidirectional long short-term memory network - attention mechanism layer, and a conditional random field layer connected in sequence. The bidirectional long short-term memory network - convolutional neural network layer includes a bidirectional long short-term memory network model and a convolutional neural network model. The bidirectional long short-term memory network - attention mechanism layer includes a bidirectional long short-term memory network model and an attention mechanism model.

[0111] Based on the above embodiments, the preset bidirectional long short-term memory network - conditional random field model processes the fusion feature vector based on the first letter of the pinyin, characters, and words of the electronic medical record to be recognized, so as to obtain the medical entity recognition result corresponding to the electronic medical record to be recognized, specifically including:

[0112] Input the fusion feature vector into the bidirectional long short-term memory network model in the bidirectional long short-term memory network - convolutional neural network layer to obtain a first vector;

[0113] Input the character feature vector into the convolutional neural network model in the bidirectional long short-term memory network - convolutional neural network layer to obtain a second vector;

[0114] Concatenate and fuse the first vector and the second vector to obtain a third vector;

[0115] Input the third vector into the bidirectional long short-term memory network model and the attention mechanism model in the bidirectional long short-term memory network - attention mechanism layer respectively to obtain a fourth vector output by the bidirectional long short-term memory network model and a fifth vector output by the attention mechanism model;

[0116] Concatenate and fuse the fourth vector and the fifth vector to obtain a sixth vector;

[0117] Input the sixth vector into the conditional random field layer to obtain the medical entity recognition result corresponding to the electronic medical record to be recognized.

[0118] Based on the above embodiments, the fusion feature vector of the first letter of the pinyin, characters, and words is obtained by fusing the first letter of the pinyin feature vector, character feature vector, and word feature vector of the electronic medical record to be recognized, specifically including:

[0119] Sum and fuse the first letter of the pinyin feature vector and the character feature vector to obtain a seventh vector;

[0120] Concatenate and fuse the seventh vector and the word feature vector to obtain the fusion feature vector.

[0121] Based on the above embodiments, the character feature vector and the word feature vector of the electronic medical record to be recognized are obtained based on the word vector model.

[0122] Based on the above embodiments, the first-letter pinyin feature vector of the electronic medical record to be recognized is determined based on the electronic medical record to be recognized and the annotation dictionary; the annotation dictionary is composed of medical entities obtained by sequence annotation.

[0123] Based on the above embodiments, the second vector is obtained by performing convolution and max-pooling operations on the character feature vector.

[0124] The named entity recognition device provided by the present invention can execute the above named entity recognition method, and its specific working principle and corresponding technical effects are the same as those of the above method, which will not be elaborated here.

[0125] Figure 5 An example of the entity structure diagram of an electronic device is shown as Figure 5 shown. The electronic device may include: a processor 510, a communication interface 520, a memory 530, and a communication bus 540. Among them, the processor 510, the communication interface 520, and the memory 530 communicate with each other through the communication bus 540. The processor 510 can call the logical instructions in the memory 530 to execute the named entity recognition method provided by each of the above methods.

[0126] In addition, when the logical instructions in the above-mentioned memory 530 are implemented in the form of software functional units and sold or used as an independent product, they can be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the present invention, in essence, or the part that makes a contribution to the prior art, or a part of this technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of the present invention. The foregoing storage medium includes: USB flash drives, mobile hard disks, read-only memories (ROM, Read-Only Memory), random access memories (RAM, Random Access Memory), magnetic disks, or optical disks, etc., which can store program codes.

[0127] On the other hand, the present invention also provides a computer program product. The computer program product includes a computer program stored on a non-transitory computer-readable storage medium. The computer program includes program instructions. When the program instructions are executed by a computer, the computer can execute the named entity recognition method provided by each of the above methods.

[0128] In another aspect, the present invention also provides a non-transitory computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, it realizes the named entity recognition method provided by the above-mentioned various methods.

[0129] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separated. The components shown as units may or may not be physical units, that is, they may be located in one place or distributed to multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment. A person of ordinary skill in the art can understand and implement it without creative work.

[0130] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the essence of the above technical solution, or the part that contributes to the prior art, can be embodied in the form of a software product. The computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0131] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit them. Although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements for some of the technical features. And these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A named entity recognition method, characterized in that, Including: Inputting the electronic medical record to be recognized into the named entity recognition model; Outputting the medical entity recognition result corresponding to the electronic medical record to be recognized; Wherein, the named entity recognition model is obtained after being trained based on the electronic medical record sample data and the pre-determined medical entity labels, and the named entity recognition model is used to process the fusion feature vector based on the first letter of the pinyin, characters and words of the electronic medical record to be recognized by using a preset bidirectional long short-term memory network - conditional random field model, so as to obtain the medical entity recognition result corresponding to the electronic medical record to be recognized; The fusion feature vector based on the first letter of the pinyin, characters and words is obtained by fusing the first letter of the pinyin feature vector, character feature vector and word feature vector of the electronic medical record to be recognized; The preset bidirectional long short-term memory network - conditional random field model includes an input layer, a bidirectional long short-term memory network - convolutional neural network layer, a bidirectional long short-term memory network - attention mechanism layer and a conditional random field layer which are connected in sequence. The bidirectional long short-term memory network - convolutional neural network layer includes a bidirectional long short-term memory network model and a convolutional neural network model. The bidirectional long short-term memory network - attention mechanism layer includes a bidirectional long short-term memory network model and an attention mechanism model; Processing the fusion feature vector based on the first letter of the pinyin, characters and words of the electronic medical record to be recognized by using the preset bidirectional long short-term memory network - conditional random field model to obtain the medical entity recognition result corresponding to the electronic medical record to be recognized, specifically including: Inputting the fusion feature vector into the bidirectional long short-term memory network model in the bidirectional long short-term memory network - convolutional neural network layer to obtain a first vector; Inputting the character feature vector into the convolutional neural network model in the bidirectional long short-term memory network - convolutional neural network layer to obtain a second vector; Performing concatenation fusion on the first vector and the second vector to obtain a third vector; Inputting the third vector into the bidirectional long short-term memory network model and the attention mechanism model in the bidirectional long short-term memory network - attention mechanism layer respectively to obtain a fourth vector output by the bidirectional long short-term memory network model and a fifth vector output by the attention mechanism model; Performing concatenation fusion on the fourth vector and the fifth vector to obtain a sixth vector; Inputting the sixth vector into the conditional random field layer to obtain the medical entity recognition result corresponding to the electronic medical record to be recognized; The fusion feature vector based on the first letter of the pinyin, characters and words is obtained by fusing the first letter of the pinyin feature vector, character feature vector and word feature vector of the electronic medical record to be recognized, specifically including: Performing summation fusion on the first letter of the pinyin feature vector and the character feature vector to obtain a seventh vector; Performing concatenation fusion on the seventh vector and the word feature vector to obtain the fusion feature vector.

2. The named entity recognition method according to claim 1, wherein The character feature vector and word feature vector of the electronic medical record to be recognized are obtained based on the word vector model.

3. The named entity recognition method according to claim 1, characterized in that The first letter of the pinyin feature vector of the electronic medical record to be recognized is determined based on the electronic medical record to be recognized and the annotation dictionary; the annotation dictionary is composed of medical entities obtained by sequence annotation.

4. The named entity recognition method according to claim 1, wherein The second vector is obtained by performing convolution and max pooling operations on the character feature vector.

5. A named entity recognition device, characterized in that, It includes: An input module for inputting the electronic medical record to be recognized into the named entity recognition model; An output module for outputting the medical entity recognition result corresponding to the electronic medical record to be recognized; Among them, the named entity recognition model is obtained by training based on electronic medical record sample data and predetermined medical entity tags. The named entity recognition model is used to process the fusion feature vector based on the first letter of pinyin, characters, and words of the electronic medical record to be recognized by using a preset bidirectional long short-term memory network - conditional random field model, so as to obtain the medical entity recognition result corresponding to the electronic medical record to be recognized; The fusion feature vector based on the first letter of pinyin, characters, and words is obtained by fusing the first letter of pinyin feature vector, character feature vector, and word feature vector of the electronic medical record to be recognized; The preset bidirectional long short-term memory network - conditional random field model includes an input layer, a bidirectional long short-term memory network - convolutional neural network layer, a bidirectional long short-term memory network - attention mechanism layer, and a conditional random field layer connected in sequence. The bidirectional long short-term memory network - convolutional neural network layer includes a bidirectional long short-term memory network model and a convolutional neural network model. The bidirectional long short-term memory network - attention mechanism layer includes a bidirectional long short-term memory network model and an attention mechanism model; Processing the fusion feature vector based on the first letter of pinyin, characters, and words of the electronic medical record to be recognized by using the preset bidirectional long short-term memory network - conditional random field model to obtain the medical entity recognition result corresponding to the electronic medical record to be recognized specifically includes: Inputting the fusion feature vector into the bidirectional long short-term memory network model in the bidirectional long short-term memory network - convolutional neural network layer to obtain a first vector; Inputting the character feature vector into the convolutional neural network model in the bidirectional long short-term memory network - convolutional neural network layer to obtain a second vector; Concatenating and fusing the first vector and the second vector to obtain a third vector; Inputting the third vector into the bidirectional long short-term memory network model and the attention mechanism model in the bidirectional long short-term memory network - attention mechanism layer respectively to obtain a fourth vector output by the bidirectional long short-term memory network model and a fifth vector output by the attention mechanism model; Concatenating and fusing the fourth vector and the fifth vector to obtain a sixth vector; Inputting the sixth vector into the conditional random field layer to obtain the medical entity recognition result corresponding to the electronic medical record to be recognized; The fusion feature vector based on the first letter of pinyin, characters, and words is obtained by fusing the first letter of pinyin feature vector, character feature vector, and word feature vector of the electronic medical record to be recognized, specifically including: Performing summation fusion on the first letter of pinyin feature vector and the character feature vector to obtain a seventh vector; Concatenating and fusing the seventh vector and the word feature vector to obtain the fusion feature vector.

6. An electronic device, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the named entity recognition method according to any one of claims 1 to 4.

7. A non-transitory computer-readable storage medium storing a computer program thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the named entity recognition method according to any one of claims 1 to 4.

Citation Information

Patent Citations

  • Electronic medical record named entity identifying method, device and storage medium

    CN109388807A

  • Multi-embedded named entity recognition method, device, equipment and storage medium

    CN111597815A