A Method and System for Named Entity Recognition in Electronic Medical Records Based on Deep Learning

By adopting the BigBird model dynamic fusion features in the medical named entity recognition model, and combining BiLSTM and CRF, the problem of insufficient accuracy and recognition performance of existing models in electronic medical record text processing is solved, and higher accuracy and robustness of named entity recognition are achieved.

CN118095285BActive Publication Date: 2025-06-10INST OF MEDICAL INFORMATION CHINESE ACAD OF MEDICAL SCI
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410304042.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-03-18
Publication Date
2025-06-10
Estimated Expiration
2044-03-18

AI Technical Summary

Technical Problem

Existing medical named entity recognition models have insufficient accuracy and recognition performance when processing electronic medical record text, especially in terms of lack of data and complex text processing.

Method used

The BigBird model is used to dynamically integrate Chinese character features and electronic medical record knowledge features, and combine BiLSTM and CRF to build a new deep learning model to improve the recognition accuracy of medical named entities.

Benefits of technology

Through the combination of multimodal fusion and BiLSTM+CRF, the accuracy and robustness of medical named entity recognition are significantly improved, making the model perform more powerfully when processing complex and diverse text data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118095285B_ABST
    Figure CN118095285B_ABST
Patent Text Reader

Abstract

The present invention discloses a method and system for identifying named entities in electronic medical records based on deep learning, which relates to the technical field of medical named entity recognition. It includes: S1. a data acquisition step; S2. a data preprocessing step; S3. a data partitioning step; S4. a model construction step; S5. a model training step; S6. an end-of-training step; S7. an identification step. The present invention dynamically fuses Chinese character features and electronic medical record knowledge features through the BigBird model, and combines BiLSTM and CRF to improve the accuracy and recognition performance of the BigBird model for medical named entities.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of medical named entity recognition, and in particular, to a method and system for named entity recognition of electronic medical records based on deep learning. Background Art

[0002] Chinese electronic medical record named entity recognition refers to discovering specific types of target named entities from the natural language text of electronic medical records. Medical named entity recognition refers to identifying the boundaries of medical entities from medical texts and determining the categories of different types of entities. Common categories of medical named entities include disease names, body parts, drugs, examination or test items, and symptoms, etc. Medical named entity recognition realizes medical knowledge extraction and provides a key foundation for intelligent medical question answering systems, the construction and application of medical knowledge graphs.

[0003] Currently, medical named entity recognition is implemented using deep learning models. Common models include convolutional neural network (CNN), recurrent neural network (RNN), long short term memory network (LSTM), bi-directional long-short term memory (Bi-LSTM), and self-attention mechanism, etc. The core of these models lies in using a large amount of unsupervised data to construct a multi-layer neural network model. To further improve the effect, researchers have made a lot of improvements in the feature vectors of the embedding layer, integrating dictionary information, pinyin, and radical features to enrich the feature vectors of the embedding layer. To solve the problem of data scarcity, transfer learning methods have also been introduced into the model. In addition, by introducing the attention mechanism, the computing power of the model has been improved, and the long-distance dependence problem has also been effectively solved.

[0004] Therefore, it is an urgent problem for those skilled in the art to propose a method and system for named entity recognition of electronic medical records based on deep learning, which dynamically integrates Chinese character features and electronic medical record knowledge features through the BigBird model, and combines BiLSTM and CRF to construct a new deep learning model, so as to improve the accuracy and recognition performance of the BigBird model for medical named entities. Summary of the Invention

[0005] In view of this, the present invention provides a method and system for identifying named entities in electronic medical records based on deep learning. By dynamically fusing Chinese character features and electronic medical record knowledge features through the BigBird model, and combining BiLSTM and CRF, the accuracy and recognition performance of the BigBird model for medical named entities are improved.

[0006] To achieve the above object, the present invention adopts the following technical solutions:

[0007] A method for identifying named entities in electronic medical records based on deep learning, comprising the following steps:

[0008] S1. Data acquisition step: Acquire electronic medical record text data;

[0009] S2. Data preprocessing step: Preprocess the acquired electronic medical record text data to obtain preprocessed electronic medical record text data;

[0010] S3. Data partitioning step: Partition the preprocessed electronic medical record text data into a training set and a test set;

[0011] S4. Model construction step: Based on the BigBird model, construct a medical named entity recognition model;

[0012] S5. Model training step: Input the training set into the medical named entity recognition model to train the medical named entity recognition model. After several trainings, obtain a trained medical named entity recognition model;

[0013] S6. Training end step: Input the test set into the trained medical named entity recognition model for verification, and output the final medical named entity recognition model;

[0014] S7. Recognition step: Input the electronic medical record text data to be recognized into the final medical named entity recognition model, and output the recognition result.

[0015] In the above method, optionally, the types of named entities to be recognized in the electronic medical record text data obtained in S1 include diseases and diagnoses, anatomical parts, imaging examinations, laboratory tests, drugs, and surgeries.

[0016] In the above method, optionally, in S2, first use word segmentation to process the electronic medical record text data, and then use the BIO annotation rule to perform token annotation on the word-segmented electronic medical record text data to obtain preprocessed electronic medical record text data.

[0017] In the above method, optionally, the medical named entity recognition model constructed in S4 includes an input word embedding layer, a Bigbird layer, a dynamic fusion layer, a BiLSTM layer, and a random conditional field CRF layer.

[0018] In the above method, optionally, the specific content of the model training step in S5 is as follows: Input the test set into the Bigbird model to obtain word vectors, fuse the output feature vectors, input the obtained word vectors into the BiLSTM, and perform decoding through the CRF layer to obtain the globally optimal annotation sequence. After several trainings, a trained medical named entity recognition model is obtained.

[0019] An electronic medical record named entity recognition system based on deep learning, applying the method for recognizing named entities in electronic medical records based on deep learning according to any one of the above, includes: a data acquisition module, a data preprocessing module, a data partitioning module, a model construction module, a model training module, a training end module, and an identification module;

[0020] The data acquisition module, connected to the input end of the data preprocessing module, is used to acquire electronic medical record text data;

[0021] The data preprocessing module, connected to the input end of the data partitioning module, is used to preprocess the acquired electronic medical record text data to obtain preprocessed electronic medical record text data;

[0022] The data partitioning module, connected to the input end of the model construction module, is used to partition the preprocessed electronic medical record text data into a training set and a test set;

[0023] The model construction module, connected to the input end of the model training module, is used to construct a medical named entity recognition model based on the BigBird model;

[0024] The model training module, connected to the input end of the training end module, is used to input the training set into the medical named entity recognition model, train the medical named entity recognition model, and after several trainings, obtain a trained medical named entity recognition model;

[0025] The training end module, connected to the input end of the identification module, is used to input the test set into the trained medical named entity recognition model for verification and output the final medical named entity recognition model;

[0026] The identification module is used to input the electronic medical record text data to be recognized into the final medical named entity recognition model and output the recognition result.

[0027] It can be seen from the above technical solutions that compared with the prior art, the present invention provides a method and system for recognizing named entities in electronic medical records based on deep learning, having the following beneficial effects:

[0028] (1) The multi-modal fusion method can improve the accuracy and robustness of the named entity recognition task, enabling the model to have stronger performance when processing complex and diverse text data;

[0029] (2) In the BiLSTM+CRF model, the output of BiLSTM is used as the input of CRF. BiLSTM+CRF combines the advantages of both, assigns the most likely entity label to each word, and improves the accuracy of model recognition.

[0030] (3) The BigBird model dynamically fuses Chinese character features and electronic medical record knowledge features, and combines BiLSTM and CRF to improve the accuracy and recognition performance of medical named entities in the BigBird model. Description of the Drawings

[0031] In order to more clearly illustrate the technical solutions in the embodiments of 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 only the embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained according to the provided drawings.

[0032] Figure 1 It is a flowchart of a method for identifying named entities in electronic medical records based on deep learning provided by the present invention;

[0033] Figure 2 It is a framework diagram of a medical named entity recognition model provided by an embodiment of the present invention;

[0034] Figure 3 It is a dynamic fusion flowchart provided by an embodiment of the present invention;

[0035] Figure 4 It is a structural diagram of a system for identifying named entities in electronic medical records based on deep learning provided by the present invention. Detailed Embodiments

[0036] The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the scope of protection of the present invention.

[0037] Refer to Figure 1 As shown, the present invention discloses a method for identifying named entities in electronic medical records based on deep learning, including the following steps:

[0038] S1. Data acquisition step: Obtain electronic medical record text data;

[0039] S2. Data preprocessing step: Preprocess the obtained electronic medical record text data to obtain the preprocessed electronic medical record text data;

[0040] S3. Data partitioning step: Partition the preprocessed electronic medical record text data into a training set and a test set;

[0041] S4. Model construction step: Based on the BigBird model, construct a medical named entity recognition model;

[0042] S5. Model training step: Input the training set into the medical named entity recognition model to train the medical named entity recognition model. After several trainings, obtain the trained medical named entity recognition model;

[0043] S6. Training end step: Input the test set into the trained medical named entity recognition model for verification, and output the final medical named entity recognition model;

[0044] S7. Recognition step: Input the electronic medical record text data to be recognized into the final medical named entity recognition model and output the recognition result.

[0045] Furthermore, the types of named entities to be recognized in the electronic medical record text data obtained in S1 include diseases and diagnoses, anatomical locations, imaging examinations, laboratory tests, drugs, and surgeries.

[0046] Furthermore, in S2, first use word segmentation to process the electronic medical record text data, and then use the BIO annotation rule to perform token annotation on the word-segmented electronic medical record text data to obtain the preprocessed electronic medical record text data.

[0047] Furthermore, the medical named entity recognition model constructed in S4 includes an input word embedding layer, a Bigbird layer, a dynamic fusion layer, a BiLSTM layer, and a random conditional field CRF layer.

[0048] Furthermore, the specific content of the model training step in S5 is: Input the test set into the Bigbird model to obtain word vectors, fuse the output feature vectors, input the obtained word vectors into BiLSTM, and perform decoding through the CRF layer to obtain the globally optimal annotation sequence. After several trainings, obtain the trained medical named entity recognition model.

[0049] In a specific embodiment, the total number of electronic medical record text data obtained this time is 1379, which is the original medical record data. Named entity annotation is performed on the electronic medical record text. The identified named entity types are: diseases and diagnoses, anatomical locations, imaging examinations, laboratory tests, drugs, and surgeries. The medical named entity recognition task is transformed into a sequence annotation problem. The BIO annotation rule is used to perform token annotation on the segmented text, and preprocessing and word segmentation processing need to be performed on the Chinese electronic medical record text. The BIO sequence annotation mode is adopted to annotate each character in the sentence. "B-entity type" represents the entity start character label of this entity type, "I-entity type" represents the other character labels of this entity type except the start character, and "O" represents the non-entity label. There are a total of 7 types of entities in the production data during this training, so each type of character has 15 annotation possibilities. The annotation rules for named entities are shown in Table 1 below: Table 1 Medical Named Entity Annotation Rules

[0050]

[0051] The electronic medical record data is divided into a training set and a test set according to a specific ratio, that is, 1000 pieces of text are randomly selected as the training set and 379 pieces of text are used as the test set, as shown in Table 2.

[0052] Table 2 Training Set and Test Set

[0053]

[0054] Based on the BigBird model, a medical named entity recognition model framework is constructed, as Figure 2 shown. The medical named entity recognition model includes an input word embedding layer, a Bigbird layer, a dynamic fusion layer, a bidirectional long short-term memory network (BiLSTM) layer, and a conditional random field (CRF) layer. Among them,

[0055] (1) Bigbird layer

[0056] The BigBird model processes the original sequence data. Each word in the input text is transformed into a corresponding word embedding vector, and position embeddings are added to capture the position information in the sequence. After these transformations, the embedding vectors will be transmitted to the subsequent encoder layers for further processing.

[0057] The encoder layer of the BigBird model is an improved version of the Transformer encoder structure. This encoder layer consists of multiple encoder blocks, each of which embeds a feed-forward neural network layer. With the help of the feed-forward neural network layer, the features processed by the attention mechanism can be non-linearly transformed, thereby enhancing the depth and non-linear fitting ability of the model. This layer mainly contains two fully connected layers, aiming to accurately transform and map features, so as to further extract more abstract features. The main difference from the traditional Transformer is that the BigBird encoder layer adopts a unique sparse attention mechanism, which effectively reduces the computational burden when processing long sequences. Under this mechanism, each word only establishes attention connections with some other words, reducing the computational complexity of the self-attention layer and enabling the model to process long sequence data more efficiently. In addition, the sparse attention mechanism has good flexibility in the BigBird model. By adjusting the attention pattern, it can adapt to different task requirements. While ensuring performance, this mechanism significantly improves computational efficiency and is convenient for practical applications. The self-attention mechanism of BigBird can be summarized as:

[0058]

[0059] Among them, Q 、 K 、 V are the query matrix, key matrix, and value matrix respectively, d k is the dimension of the key vector, K T is the transpose of the key matrix (the row and column positions of the matrix are interchanged), enabling the query matrix and the key matrix to perform effective similarity (or correlation) calculations through matrix multiplication, M is a mask matrix used to implement the sparse attention mechanism. It has negative infinity values at positions where attention is not calculated (before softmax), so that the attention weights at these positions are close to zero after softmax.

[0060] The core of the sparse attention mechanism lies in constructing the mask matrix M . MThe matrix combines three methods: the global attention mechanism, the sliding attention mechanism, and the random attention mechanism. In the standard global attention mechanism, each word (node) directly interacts with all other words within a single layer, forming a comprehensive attention network. This mechanism is highly effective for short sequences and can capture the relationships between any two words in the sequence. However, as the sequence length increases, the computational complexity and memory requirements of the global attention mechanism increase sharply. To address this issue, BigBird introduces the sliding attention mechanism and the random attention mechanism. The sliding attention mechanism limits the direct connections of each word to its neighboring words, thereby reducing the computational complexity while retaining sensitivity to local context. The random attention mechanism enhances the model's ability to capture long-range dependencies by introducing random connections in the sequence, enabling the model to effectively process information and capture context information over a large range even in long sequences. After being processed by the encoder layer, the BigBird model will receive the information outputs of different levels of the encoder layer and input them into the subsequent structure.

[0061] (2) Dynamic Fusion Layer

[0062] The BigBird model is based on the Transformer architecture, which can capture different levels of information in text, including surface features, syntactic information, and semantic features. However, the representation vectors output by different levels of the Transformer encoder vary in importance. To make full use of the different representation information of each layer of the Transformer, a dynamic fusion mechanism is introduced. In the dynamic fusion layer of the model, initial weight assignments are made to the representation vectors generated by the n layers of the BigBird Transformer. Subsequently, during the training process, these weights will be dynamically adjusted according to the optimization needs of the model performance. The representation vectors of each layer are dynamically fused through weighted combination to maximize the potential of the text representation information of each layer.

[0063] The specific computational process of dynamic fusion is as follows Figure 3 shown: First, the output representations hi of each layer of the Transformer in the BigBird model are weighted and summed, where αi represents the weight value assigned to the output of each layer. Then, the result of the weighted sum is processed through dimensionality reduction to 512 dimensions. In addition, combined with the custom word vectors, the processed representation is used as the input to the bidirectional long short-term memory network (BiLSTM).

[0064] Through dynamic fusion, the text representation information of different levels of the BigBird model can be better utilized, further improving the performance of the Chinese electronic medical record medical named entity recognition algorithm.

[0065] (3)Custom word vectors (pinyin, Wubi, strokes, Zhengma, glyphs)

[0066] In the present invention, the BigBird model has been able to effectively capture the semantic information of words. However, entity recognition in text data not only depends on semantic information but also involves other attributes of words, such as pinyin, Wubi, strokes, Zhengma, and glyphs. These non-semantic attributes can provide additional information, offering extra information about the word structure and representation to the model, thereby enhancing the model's ability to understand and recognize specific entities in Chinese electronic medical record texts.

[0067] Pinyin word vectors can provide the phonetic information of words. For some words with the same semantics but different pronunciations, pinyin word vectors can help the model distinguish them, thus improving the accuracy of NER.

[0068] Wubi word vectors are generated based on the Wubi input method and can reflect the stroke characteristics of words. For some words with the same semantics but different strokes, Wubi word vectors can help the model distinguish them and improve the accuracy of NER.

[0069] Stroke word vectors can provide the stroke information of words. For some words with the same semantics but different strokes, stroke word vectors can help the model distinguish them and improve the accuracy of NER.

[0070] Zhengma word vectors are generated based on the Zhengma input method and can reflect the character combination characteristics of words. For some words with the same semantics but different character combinations, Zhengma word vectors can help the model distinguish them and improve the accuracy of NER.

[0071] Glyph word vectors can provide the glyph information of words. For some words with the same semantics but different glyphs, glyph word vectors can help the model distinguish them and improve the accuracy of NER.

[0072] By adding word vectors such as pinyin, Wubi, strokes, Zhengma, and glyphs, the information of the input vector can be enriched, helping the model better understand and recognize entities in the text. This multi-modal fusion method can improve the accuracy and robustness of the named entity recognition task, enabling the model to have stronger performance when dealing with complex and diverse text data.

[0073] (4)BiLSTM layer

[0074] The Bidirectional Long Short-Term Memory (BiLSTM) is composed of two LSTM networks, which process forward and backward sequence information respectively. LSTM (Long Short-Term Memory) is an improvement of the Recurrent Neural Network (RNN). RNN is suitable for processing sequence problems. It is a model that gradually constructs a prediction sequence to predict the result at the end of the sequence. It uses the prediction result of each word as a feature and predicts together with the next word, and so on until the last word. In this process, the model shares a set of parameters to reduce the number of model parameters and prevent overfitting.

[0075] LSTM is an improvement based on RNN to enable it to capture longer distance dependency information. However, whether it is LSTM or RNN, when processing sequences, the later words are often more important than the previous words. To solve this problem, we introduce BiLSTM. BiLSTM first executes an LSTM from left to right, then executes an LSTM from right to left, and finally combines the results of the two times. Such a structure makes BiLSTM very suitable for processing context-related sequence labeling tasks and can capture the context information of the sequence at the same time.

[0076] In the BiLSTM layer, the input integrates three key parts: the output of the BigBird model, the result of the dynamic fusion mechanism, and the embedded output of other specific word feature vectors. To adapt to the model structure and optimize the subsequent processing flow, a projection layer is introduced between the BiLSTM layer and the embedded output. The main role of the projection layer is to transform the data shape to ensure that the output format is [batch_size, num_steps, num_tags], where batch_size represents the batch size, num_steps is the length of the input sentence (set to a maximum of 128), and num_tags corresponds to the number of categories in the sequence labeling task.

[0077] (5) Conditional Random Field (CRF) layer

[0078] Conditional Random Field (CRF) is an advanced probabilistic model based on the principle of Markov Random Field (MRF) and plays a crucial role in sequence labeling tasks such as Named Entity Recognition (NER). In the NER task, the CRF layer captures and utilizes the dependencies between labels by defining the transition probabilities between potential labels, ensuring that the assignment of adjacent labels in the sequence is not independent. The CRF layer is usually located at the top of a neural network model (such as BiLSTM or Transformer), receives the feature representations of the network as input, and learns the optimal label sequence by optimizing the conditional probability model. This optimization involves maximizing the log-likelihood of the true label sequence, thereby effectively learning the model parameters. Therefore, the application of the CRF layer not only enhances the model's ability to handle label dependencies but also significantly improves the overall prediction accuracy, becoming a key component in modern sequence labeling tasks.

[0079] Markov Random Field is a model-based representation of probability distribution, and its core feature lies in local dependence. Specifically, the assignment of a value at a certain position in the MRF is only related to its adjacent positions in the graph structure and has nothing to do with non-adjacent positions. This local dependence makes the MRF highly advantageous in dealing with sequence data and spatial data, especially in sequence labeling problems. In the absence of the CRF layer, relying solely on the BiLSTM layer for independent lexical label prediction may generate label sequences that do not conform to the actual logic, such as [B-Disease, O, I-Disease, O, I-Drug]. This sequence violates the continuity rule of internal entity labels. To solve this problem, the introduction of the CRF layer is crucial.

[0080] The CRF layer ensures that the generated label sequence conforms to the annotation rules of entity recognition by adding structured constraint conditions at the output end of the BiLSTM. These constraint conditions enable the CRF layer to not only focus on the prediction of individual labels but also consider the overall rationality of the label sequence, especially the transition probabilities between labels. During the training process, the CRF layer can automatically learn and optimize the entire label sequence, effectively reducing the generation of illegal or illogical sequences. This global optimization strategy significantly improves the accuracy of the NER task, ensuring the reliability and rationality of the model's prediction results.

[0081] In the BiLSTM+CRF model, the output of the BiLSTM serves as the input of the CRF, and the label sequence of the entire sequence is determined by calculating the maximum probability of the current label given the previous label. BiLSTM+CRF can combine the advantages of both to assign the most likely entity label to each word.

[0082] That is, the training steps are to input the training set into the Bigbird model to obtain word vectors, fuse the output feature vectors, input the obtained word vectors into the BiLSTM respectively, and decode through the CRF layer to obtain the globally optimal annotation sequence. The training parameters are set as shown in Table 3 below.

[0083] Table 3 Parameter Settings

[0084]

[0085] Input the test set into the trained medical named entity recognition model for verification, and output the final medical named entity recognition model. The test results of the trained test data are shown in Table 4 below.

[0086] Table 4 Model Test Results

[0087]

[0088] In the training of the medical named entity recognition model of the present invention, the precision P, recall rate R, and F1 value are used as evaluation indicators to comprehensively evaluate the performance of the model.

[0089] Precision P (Precision): Precision is the proportion of samples that are truly positive among the samples predicted as positive by the model. It reflects the accuracy of the model in identifying entities, and the calculation formula is: P = TP / (TP + FP), where TP represents true positives and FP represents false positives.

[0090] Recall rate R (Recall): Recall rate is the proportion of samples that are correctly identified as positive by the model among all samples that are actually positive. It reflects the ability of the model to capture all relevant entities, and the calculation formula is: R = TP / (TP + FN), where TP represents true positives and FN represents false negatives.

[0091] F1 value: The F1 value is the harmonic mean of precision and recall, used to comprehensively consider the performance of precision and recall. The higher the F1 value, the better the model performs in terms of precision and recall. The calculation formula is: F1 value = 2 * (P * R) / (P + R).

[0092] By comprehensively considering these three indicators, the performance of the entity recognition model can be comprehensively evaluated, and the model can be optimized and improved according to its performance. The specific model evaluation indicators are shown in Table 5 below.

[0093] Table 5 Model Evaluation Indicators

[0094]

[0095] The comparison results of the effects between the present invention and the mainstream recognition methods are shown in Table 6.

[0096] Table 6 Comparison of the effects between the present invention and mainstream recognition methods

[0097]

[0098] Conclusion: By comparing the present invention with mainstream recognition methods, good effects have been achieved, and the accuracy and recognition performance of medical named entities of the BigBird model have been improved.

[0099] Compared with Figure 1 the method described above, an embodiment of the present invention further provides a deep learning-based electronic medical record named entity recognition system for Figure 1 the specific implementation of the method in Figure 4 as shown in the figure, which specifically includes: a data acquisition module, a data preprocessing module, a data partitioning module, a model construction module, a model training module, a training end module, and a recognition module;

[0100] The data acquisition module is connected to the input end of the data preprocessing module and is used to acquire electronic medical record text data;

[0101] The data preprocessing module is connected to the input end of the data partitioning module and is used to preprocess the acquired electronic medical record text data to obtain preprocessed electronic medical record text data;

[0102] The data partitioning module is connected to the input end of the model construction module and is used to partition the preprocessed electronic medical record text data into a training set and a test set;

[0103] The model construction module is connected to the input end of the model training module and is used to construct a medical named entity recognition model based on the BigBird model;

[0104] The model training module is connected to the input end of the training end module and is used to input the training set into the medical named entity recognition model to train the medical named entity recognition model. After several trainings, a trained medical named entity recognition model is obtained;

[0105] The training end module is connected to the input end of the recognition module and is used to input the test set into the trained medical named entity recognition model for verification and output the final medical named entity recognition model;

[0106] The recognition module is used to input the electronic medical record text data to be recognized into the final medical named entity recognition model and output the recognition result.

[0107] The foregoing description of the disclosed embodiments enables those skilled in the art to practice or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A method for named entity recognition in electronic medical records based on deep learning, characterized in that: The following steps are involved: S1. Data acquisition step: obtaining electronic medical record text data; S2. Data preprocessing step: preprocessing the acquired electronic medical record text data to obtain preprocessed electronic medical record text data; S3. Data division step: dividing the preprocessed electronic medical record text data into a training set and a test set; S4. Model construction steps: Based on the BigBird model, a medical named entity recognition model is constructed; S5. Model training step: inputting the training set into the medical named entity recognition model, training the medical named entity recognition model, and obtaining a trained medical named entity recognition model after several trainings; S6. Training end step: input the test set into the trained medical named entity recognition model for verification, and output the final medical named entity recognition model; S7. Recognition step: input the electronic medical record text data to be recognized into the final medical named entity recognition model and output the recognition result; The medical named entity recognition model constructed in S4 includes input word embedding layer, Bigbird layer, dynamic fusion layer, BiLSTM layer and random conditional field CRF layer; The encoder layer of the Bigbird layer consists of multiple encoder blocks, each of which embeds a feedforward neural network layer. With the help of the feedforward neural network layer, the features processed by the attention mechanism can achieve nonlinear transformation. The attention mechanism is summarized as follows: Among them, Q, K, and V are query matrix, key matrix, and value matrix respectively. k is the dimension of the key vector, K T is the transpose of the key matrix, M is the mask matrix; The specific content of the model training steps in S5 is: input the test set into the Bigbird model to obtain representation vectors of different levels, introduce a dynamic fusion mechanism to fuse the representation vectors of different levels, combine with custom word vectors, use the processed representation as the input of BiLSTM, decode through the CRF layer, and obtain the global optimal annotation sequence. After several trainings, a trained medical named entity recognition model is obtained.

2. According to claim 1, a method for electronic medical record named entity recognition based on deep learning is characterized in that: The named entity types to be identified in the electronic medical record text data obtained in S1 include diseases and diagnoses, anatomical parts, imaging examinations, laboratory tests, drugs, and surgeries.

3. According to the method for electronic medical record named entity recognition based on deep learning in claim 1, it is characterized in that: In S2, the electronic medical record text data is first processed by word segmentation, and then the token is annotated on the word segmented electronic medical record text data using the BIO annotation rule to obtain the preprocessed electronic medical record text data.

4. A deep learning-based electronic medical record named entity recognition system, characterized in that: A method for identifying named entities in electronic medical records based on deep learning according to any one of claims 1 to 3 is applied, comprising: a data acquisition module, a data preprocessing module, a data partitioning module, a model building module, a model training module, a training end module, and an identification module; A data acquisition module, connected to the input end of the data preprocessing module, is used to acquire electronic medical record text data; A data preprocessing module, connected to the input end of the data partitioning module, is used to preprocess the acquired electronic medical record text data to obtain preprocessed electronic medical record text data; A data partitioning module, connected to the input end of the model building module, for partitioning the preprocessed electronic medical record text data into a training set and a test set; A model building module, connected to the input end of the model training module, is used to build a medical named entity recognition model based on the BigBird model; A model training module is connected to the input end of the training end module and is used to input the training set into the medical named entity recognition model to train the medical named entity recognition model. After several trainings, a trained medical named entity recognition model is obtained. A training end module, connected to the input end of the recognition module, is used to input the test set into the trained medical named entity recognition model for verification, and output the final medical named entity recognition model; The recognition module is used to input the electronic medical record text data to be recognized into the final medical named entity recognition model and output the recognition results.

Citation Information

Patent Citations

  • Chinese electronic medical record named entity recognition method and system based on functional structure

    CN112949308A

  • Colorectal tumor pathological text named entity recognition method and system

    CN117114000A