A method, system, device and storage medium for producing a disease-specific database
By combining deep models and machine learning models to identify and extract entities and relationships in electronic medical records, the problem of deep models in the existing technology needs to be retrained is solved, and a more flexible and efficient production of specialized disease databases is achieved.
Patent Information
- Application Number
- CN202411267082.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-11
- Publication Date
- 2025-04-22
- Estimated Expiration
- 2044-09-11
AI Technical Summary
Existing depth models identify differences in performance of entities and relationships in electronic medical records in different hospitals, resulting in the need to retrain the model, which is costly and poorly flexible.
By combining pre-trained deep model and machine learning model, the entities and relationships in the target electronic medical record can be identified. If the required entities cannot be directly extracted, the machine learning model will be used for recognition and training, and the recognition results of the deep model will be gradually improved.
It avoids retraining of deep models, reduces costs, increases the applicability to the production of medical specialized disease databases in different hospitals, and makes the production of specialized disease databases more flexible.
Smart Images

Figure CN118779399B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of medical disease-specific database production, and in particular to a disease-specific database production method, system, device and storage medium. Background Art
[0002] In the medical field, disease-specific databases, such as the lung nodule disease database, depression disease database, diabetes disease database, hypertension disease database, etc., are databases specifically established for a single disease that contain the clinical data and follow-up information of patients with that disease. They are also called specialist databases.
[0003] At present, disease-specific databases are usually built by hospital, that is, different hospitals usually build their own disease-specific databases. The production method of disease-specific databases is generally to identify existing entities and relationships from medical cases through deep models, and then return the parsing results through code parsing models to obtain the content required by the fields in the disease-specific database, thereby completing the construction or production of the disease-specific database.
[0004] However, the way existing deep models identify entities and relationships in electronic medical records varies from hospital to hospital. In some cases, deep models need to be retrained based on the hospital's writing habits, which is too costly and inflexible. Summary of the invention
[0005] To solve the above problems, the present invention provides a method, system, device and storage medium for producing a disease-specific database, which are used to avoid retraining of deep models, thereby reducing costs and increasing flexibility of use.
[0006] In a first aspect, the present invention provides a method for generating a disease-specific database, the method comprising:
[0007] S1. Input the target electronic medical record, which is the electronic medical record used to generate the target disease-specific database; the target disease-specific database (i.e., the target disease-specific database) is the disease-specific database to be generated;
[0008] S2, traversing each input target electronic medical record;
[0009] S3, identifying entities and relationships in the currently traversed target electronic medical record through a pre-trained deep model to obtain a first recognition result;
[0010] S4. Extracting entities required for fields of the target disease database from the first recognition result:
[0011] If the entity required by the field of the target disease database can be extracted, the content of the extracted entity is written into the corresponding field of the target disease database, and then the next target electronic medical record is traversed and the process goes to step S3 to continue until all target electronic medical records input in step S1 are traversed;
[0012] If the entity required by the field of the target disease database cannot be extracted, step S5 is executed;
[0013] S5, using a pre-trained machine learning model to identify entities and relationships in the currently traversed target electronic medical record, obtaining a second recognition result, and then executing S6;
[0014] S6. Fusing the first recognition result and the second recognition result to obtain a final recognition result corresponding to the currently traversed target electronic medical record;
[0015] S7, extracting entities required by the fields of the target disease database from the final recognition result: if the entities required by the fields of the target disease database can be extracted, executing step S9; otherwise, sampling from all target electronic medical records input in step S1 to construct a new training set to retrain the machine learning model, obtain a trained new machine learning model, and then execute step S8;
[0016] S8, using the new machine learning model obtained by the latest training in step S7 to identify entities and relationships existing in the target electronic medical record currently traversed, to obtain a new second recognition result, and then using the new second recognition result to replace the second recognition result obtained by using the machine learning model to identify the target electronic medical record currently traversed, and then going to step S6 to continue execution;
[0017] S9. Write the content of the extracted entity into the corresponding field of the target disease database, then continue to traverse the next target electronic medical record, and use the new machine learning model most recently trained in step S7 to replace the pre-trained machine learning model, and go to step S3 to continue execution until all target electronic medical records entered in step S1 are traversed.
[0018] Further, step S6 includes:
[0019] S61, fusing the entity recognition result of the first recognition result and the second recognition result to obtain a fused entity recognition result;
[0020] S62, fusing the relationship recognition result of the first recognition result and the second recognition result to obtain a fused relationship recognition result;
[0021] S63, collecting the fused entity recognition results and the fused relationship recognition results to obtain the final recognition result.
[0022] Further, step S61 includes:
[0023] S611, traversing the entity recognition results of the second recognition result, and for each traversed entity, performing the following steps respectively: if there is an entity in the entity recognition result of the first recognition result that has the same starting position and ending position as the currently traversed entity and a different entity label, then modifying the label of the existing entity in the first recognition result to the label of the entity in the entity recognition result of the currently traversed second recognition result; otherwise, no processing is performed;
[0024] S612, based on step S611, obtaining a modified entity recognition result of the first recognition result;
[0025] S613: Take a union of the entity recognition result of the second recognition result and the modified entity recognition result of the first recognition result to obtain a fused entity recognition result.
[0026] Further, step S62 includes:
[0027] S621, traversing the relationship recognition results of the second recognition result, and for each traversed relationship, performing the following steps respectively: if there is a relationship in the relationship recognition result of the first recognition result that has the same head entity and tail entity as the currently traversed relationship but a different relationship label, then modify the label of the existing relationship in the first recognition result to the label of the relationship in the relationship recognition result of the currently traversed second recognition result; otherwise, no processing is performed;
[0028] S622, based on step S621, obtaining a modified relationship recognition result of the first recognition result;
[0029] S623: Take the union of the relationship recognition result of the second recognition result and the modified relationship recognition result of the first recognition result to obtain a fused relationship recognition result.
[0030] Furthermore, the training method of the deep model includes:
[0031] a. Constructing a first training set; the method for constructing the first training set includes:
[0032] Collect historical electronic medical records corresponding to the target disease, where the target disease is the disease corresponding to the target disease database;
[0033] Using the pre-set sentence segmentation rules, the collected texts of each historical electronic medical record are split into several sentences;
[0034] The entities and relations in each sentence obtained by the splitting are annotated; the entities are annotated, including the start position, end position, entity content and entity label of the entities; the relations are annotated, including the start entity, end entity and relationship label of the relations;
[0035] Collect all the labeled sentences to obtain the first training set;
[0036] b. Model construction:
[0037] Build a global pointer model;
[0038] Randomly initialize the weights of the constructed global pointer model to obtain the initial depth model;
[0039] c. Using the first training set to train the initial depth model, the specific training method includes:
[0040] The data in the first training set is input into the initial deep model for iterative training. In each iterative training, the input data is converted into word vectors, and the logit score of each word vector is calculated. A prediction matrix is generated based on the calculated logit score of each word vector. The cross entropy loss function is then used to calculate the loss between the prediction matrix and the true label matrix corresponding to the data in the training set. The model gradient is then calculated based on the calculated loss through the back propagation algorithm, and the model parameters are updated using the Adam optimizer until the model converges or reaches a preset number of iterations. The training ends and a trained deep model is obtained.
[0041] Further, the training method of the machine learning model:
[0042] d. constructing a training set; the construction of the training set includes constructing a second training set and a third training set;
[0043] The construction method of the second training set includes:
[0044] Step d1, collect historical electronic medical records corresponding to the target disease;
[0045] Step d2: using a preset sentence segmentation rule to split the text of each collected historical electronic medical record into several sentences;
[0046] Step d3, traverse each sentence obtained in step d2, when traversing to the first sentence, store this sentence in a preset list of data to be annotated, and convert this sentence into a vector by using the TF-IDF (Term Frequency-Inverse Document Frequency) algorithm, store it in a preset vector list, and then continue to traverse the next sentence; each time traversing to the next sentence, convert the next sentence traversed to a vector by using the TF-IDF algorithm, then calculate the cosine similarity between the vector and each vector in the vector list, and calculate the average value of the cosine similarity between the vector and each vector in the vector list, then determine whether the average value is greater than or equal to a preset similarity mean threshold, if so, discard this sentence, if not, add the vector converted by the TF-IDF algorithm of this sentence to the vector list, and add this sentence to the list of data to be annotated, and so on, until all sentences obtained in step d2 are traversed;
[0047] Step d4, annotating the entities in each sentence in the list of data to be annotated finally obtained in step d3; wherein the entity is annotated, including the start position, end position, entity content and entity label of the annotated entity;
[0048] Step d5, collect each sentence marked in step d4 to obtain a second training set;
[0049] The construction method of the third training set includes:
[0050] Step d1', obtaining each sentence in the list of data to be annotated finally obtained in step d3;
[0051] Step d2', annotating the entities and relations in each sentence in the list of data to be annotated finally obtained in step d3;
[0052] Step d3', collect all the sentences annotated in step d2' to obtain a third training set;
[0053] e. Construction of initial model:
[0054] Construct a hidden Markov model, initialize the model's state probability vector, state transition probability matrix and observation probability matrix by random initialization method, and obtain the initialized hidden Markov model;
[0055] Build a Piece-Wise-CNN model, set the hyperparameters of the number of network layers and pooling method, and obtain the initial Piece-Wise-CNN model;
[0056] f. Hidden Markov model training:
[0057] The data of the second training set is input into the initial hidden Markov model for iterative training. In each iterative training, the model generates a prediction matrix based on the state probability vector, state transition probability matrix and observation probability matrix of the model, and calculates the loss based on the prediction matrix and the true label through the loss function. Then, the model gradient is calculated through the back propagation algorithm based on the calculated loss, and the state probability vector, state transition probability matrix and observation probability matrix are updated using the optimizer until the model converges or reaches a preset number of iterations. The training ends and a trained hidden Markov model is obtained; the trained hidden Markov model is an entity recognition model;
[0058] g. Piece-Wise-CNN model training:
[0059] The text data of the third training set is input into the initial Piece-Wise-CNN model for iterative training. In each iterative training, the input text data is positionally encoded and converted into word vectors through the word embedding layer. Then, the features of the input text data are extracted based on the position encoding and word vectors through the convolution layer. Then, the relationship is classified through the classifier to obtain the predicted probability distribution of various relationships in the input text data. Then, the loss between the predicted probability distribution and the true label is calculated through the cross entropy loss function model, and the model parameters are updated through back propagation according to the calculated loss until the model converges or reaches a preset number of iterations. The training ends and the trained Piece-Wise-CNN model is obtained. The trained Piece-Wise-CNN model is a relationship recognition model.
[0060] The trained hidden Markov model and the trained Piece-Wise-CNN model constitute a trained machine learning model.
[0061] Furthermore, each field of the target disease-specific database is equipped with a field label; the field label of the target disease-specific database is set in the same way as the entity label;
[0062] Methods for extracting entities required for fields of the target disease database from the recognition results include:
[0063] From the entity recognition results of the recognition results, find the entity whose entity content is related to the target disease as the first entity; the target disease is the disease corresponding to the target disease database;
[0064] Based on the relationship recognition results of the recognition results, all entities related to the first entity are found and used as second entities respectively;
[0065] Comparing whether the entity label of each second entity is the same as the field label of the target disease database;
[0066] All second entities whose entity tags are the same as the field tags of the target disease database are extracted, and all entities required for the fields of the target disease database extracted from the recognition results are obtained.
[0067] In a second aspect, the present invention further provides a disease-specific database generation system, the system comprising:
[0068] The medical record input module is used to input the target electronic medical record, where the target electronic medical record is the electronic medical record used to generate the target disease-specific database; the target disease-specific database is the disease-specific database to be generated;
[0069] The first traversal module is used to traverse each input target electronic medical record;
[0070] A first recognition module is used to recognize entities and relationships in the currently traversed target electronic medical record through a pre-trained deep model to obtain a first recognition result;
[0071] The first extraction module is used to extract the entities required by the fields of the target disease database from the first recognition result: if the entities required by the fields of the target disease database can be extracted, the contents of the extracted entities are written into the corresponding fields of the target disease database, and then the next target electronic medical record is traversed and the first recognition module is called until all target electronic medical records input by the medical record input module are traversed; if the entities required by the fields of the target disease database cannot be extracted, the second recognition module is called;
[0072] The second recognition module is used to use a pre-trained machine learning model to identify entities and relationships in the target electronic medical record currently traversed, obtain a second recognition result, and then call the fusion module;
[0073] A fusion module, used to fuse the first recognition result and the second recognition result to obtain a final recognition result corresponding to the target electronic medical record currently traversed;
[0074] The second extraction module is used to extract the entities required by the fields of the target disease database from the final recognition result: if the entities required by the fields of the target disease database can be extracted, the data writing module is called; otherwise, a new training set is constructed by sampling from all target electronic medical records input by the medical record input module to retrain the machine learning model, and a trained new machine learning model is obtained, and then the third recognition module is called;
[0075] A third recognition module is used to use the new machine learning model newly trained in the second extraction module to identify entities and relationships in the currently traversed target electronic medical record, obtain a new second recognition result, and then use the new second recognition result to replace the second recognition result obtained by using the machine learning model to identify the currently traversed target electronic medical record, and then call the fusion module;
[0076] The data writing module is used to write the content of the extracted entity into the corresponding field of the target disease database, and is also used to continue to traverse the next target electronic medical record and replace the pre-trained machine learning model with the new machine learning model most recently trained in the second extraction module, and then call the first recognition module until all target electronic medical records input by the medical record input module are traversed.
[0077] In a third aspect, the present invention provides a terminal, comprising:
[0078] processor;
[0079] A memory for storing execution instructions of the processor;
[0080] The processor is configured to execute the methods described in the above aspects.
[0081] In a fourth aspect, the present invention provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the methods described in the above aspects.
[0082] Compared with the prior art, the present invention has the following beneficial effects:
[0083] The present invention first uses a deep model to produce a medical disease database. When the deep model performs poorly, it can integrate the machine learning model to produce the medical disease database. This not only avoids the retraining of the deep model, but also helps to solve the problem of excessively high costs caused by retraining the deep model. It also helps to increase the applicability of the production of medical disease databases for different hospitals to a certain extent, making the production of disease databases more flexible.
[0084] The present invention integrates the recognition results of the machine learning model and the deep model, and can modify or improve the recognition results of the deep model through the machine learning model, which helps to better complete the production of medical disease databases.
[0085] The invention has reliable design principle, simple structure and very broad application prospect. BRIEF DESCRIPTION OF THE DRAWINGS
[0086] In order to more clearly illustrate the embodiments of the present invention or the technical solutions of the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0087] Figure 1 is a schematic flow chart of a method according to an embodiment of the present invention;
[0088] Figure 2 is a schematic block diagram of a system according to an embodiment of the present invention;
[0089] Figure 3 A schematic diagram of the structure of a terminal provided by an embodiment of the present invention;
[0090] Figure 4 It is a structural schematic diagram of a computer storage medium provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0091] The core of the present invention is to produce a medical disease database by combining a deep model with a machine learning model. When the deep model performs poorly, the machine learning model can be integrated to produce a medical disease database.
[0092] To make the technical solution and advantages of the present invention more clear, the technical solution of the present invention will be described clearly and completely below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments.
[0093] The following description of at least one exemplary embodiment is actually only illustrative and is by no means intended to limit the present invention and its application or use. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0094] In the following description, many specific details are set forth to facilitate a full understanding of the present invention, but the present invention may also be implemented in other ways different from those described herein, and those skilled in the art may make similar generalizations without violating the connotation of the present invention. Therefore, the present invention is not limited to the specific embodiments disclosed below.
[0095] It should be noted that the present invention uses words such as "first" and "second" to limit the corresponding parts only to facilitate the distinction of the corresponding parts. If not otherwise stated, the above words have no special meaning and therefore cannot be understood as limiting the scope of protection of the present invention.
[0096] The technical solution of the present invention will be introduced and explained below through several embodiments.
[0097] Please refer to Figure 1 , which shows a schematic flow chart of a method for generating a disease-specific database provided by an embodiment of the present invention.
[0098] like Figure 1 As shown, the method for generating a disease-specific database includes:
[0099] Step S1, inputting a target electronic medical record, where the target electronic medical record is an electronic medical record used to generate a target disease-specific database;
[0100] Step S2, traversing each input target electronic medical record;
[0101] Step S3: Identify entities and relationships in the currently traversed target electronic medical record through a pre-trained deep model to obtain a first recognition result;
[0102] Step S4: extract the entities required for the fields of the target disease database from the first recognition result:
[0103] If the entity required by the field of the target disease database can be extracted, the content of the extracted entity (i.e., the entity content) is written into the corresponding field of the target disease database, and then the next target electronic medical record is traversed and the process goes to step S3 to continue until all target electronic medical records input in step S1 are traversed;
[0104] If the entity required by the field of the target disease database cannot be extracted, step S5 is executed;
[0105] Step S5, using a pre-trained machine learning model to identify entities and relationships in the currently traversed target electronic medical record, obtaining a second recognition result, and then executing S6;
[0106] Step S6, fusing the first recognition result and the second recognition result to obtain a final recognition result corresponding to the currently traversed target electronic medical record;
[0107] Step S7, extracting entities required by the fields of the target disease database from the final recognition result: if the entities required by the fields of the target disease database can be extracted, executing step S9; otherwise, sampling from all target electronic medical records input in step S1 to construct a new training set to retrain the machine learning model, obtain a trained new machine learning model, and then execute step S8;
[0108] Step S8, using the new machine learning model most recently trained in step S7 to identify entities and relationships in the currently traversed target electronic medical record, to obtain a new second recognition result, and then using the new second recognition result to replace the second recognition result obtained by using the machine learning model to identify the currently traversed target electronic medical record last time, and then going to step S6 to continue execution;
[0109] Step S9, write the content of the extracted entity into the corresponding field of the target disease database, then continue to traverse the next target electronic medical record, and use the new machine learning model most recently trained in step S7 to replace the pre-trained machine learning model, and go to step S3 to continue execution until all target electronic medical records entered in step S1 are traversed.
[0110] The target disease-specific database is a disease-specific database to be generated.
[0111] The first recognition result and each second recognition result involved in the present invention each include an entity recognition result and a relationship recognition result.
[0112] It can be understood that an electronic medical record can usually identify several entities and several relationships. Correspondingly, each entity recognition result may include several recognized entities, and a relationship recognition result may include several recognized relationships.
[0113] In the entity recognition results, each recognized entity includes the entity start position, entity end position, entity label and entity content.
[0114] For example, there are two entities in an entity recognition result:
[0115] {'start':3, 'end': 12, 'text':'September 20, 1996', 'label':'Time'};
[0116] {'start': 15, 'end':16, 'text':'Lung cancer', 'label':'Disease'}.
[0117] That is, "3" and "15" are the starting positions of the entity, "12" and "16" are the ending positions of the entity, "time" and "disease" are entity labels, and "September 20, 1996" and "lung cancer" are entity contents.
[0118] In the relationship recognition result, each recognized relationship includes a relationship label and two entities corresponding to the relationship. The two entities corresponding to the relationship are the head entity and the tail entity.
[0119] The head entity and the tail entity are a pair of entities that have a relationship in the relationship recognition result.
[0120] For example, in a relationship recognition result, there is the following relationship: {'from': 'September 20, 1996', 'to': 'Lung cancer', 'label': 'Modification'}. In this relationship, "September 20, 1996" and "Lung cancer" are two entities in the relationship, "September 20, 1996" is the head entity, and "Lung cancer" is the tail entity. In addition, "Modification" in the above relationship is the relationship label.
[0121] The method for generating a disease-specific database described in the present invention is used for constructing a disease-specific database of a single medical institution.
[0122] It can be understood that the target electronic medical records input in step S1 can be all electronic medical records in the target hospital used to generate its target disease-specific database. The target hospital is any single medical institution (such as a hospital) that uses the present invention to build a disease-specific database.
[0123] That is, the target electronic medical record input in step S1 is the on-site data used by the target hospital to generate or construct its target disease-specific database.
[0124] It can be understood that for the same electronic medical record, if the starting position and the ending position of the entity are the same, the entity content is the same, and correspondingly, the entity label should also be the same.
[0125] That is, for the same electronic medical record, if the starting position and the ending position of the entity are the same, then in the identified results, the entity content and the entity label of the entity should actually be the same.
[0126] It is understandable that those skilled in the art may set the entity tag according to actual conditions.
[0127] It can be understood that the entity required by the field of the target disease database is the entity corresponding to the field of the target disease database. For example, a target disease database A has a field called "illness time". Assuming that the entity required by the field "illness time" is entity B, entity B is the entity that needs to be extracted, and the field "illness time" of the target disease database A is the corresponding field of the extracted entity B. The entity content of entity B is the content that needs to be added or written to the field "illness time" of the target disease database A.
[0128] Optionally, in step S6, the first recognition result and the second recognition result are merged to obtain a final recognition result corresponding to the currently traversed target electronic medical record, including:
[0129] S61, fusing the entity recognition result of the first recognition result and the second recognition result to obtain a fused entity recognition result;
[0130] S62, fusing the relationship recognition result of the first recognition result and the second recognition result to obtain a fused relationship recognition result;
[0131] S63, collecting the fused entity recognition results and the fused relationship recognition results to obtain the final recognition result.
[0132] Optionally, step S61 includes:
[0133] S611, traversing the entity recognition results of the second recognition result, and for each traversed entity, performing the following steps respectively: if there is an entity in the entity recognition result of the first recognition result that has the same starting position and ending position as the currently traversed entity and a different entity label, then modify the entity label of the existing entity in the first recognition result (that is, the entity in the first recognition result that has the same starting position and ending position as the currently traversed entity and a different entity label) to the label of the entity in the entity recognition result of the currently traversed second recognition result; otherwise, no processing is performed;
[0134] S612, based on step S611, obtaining a modified entity recognition result of the first recognition result;
[0135] S613: Take a union of the entity recognition result of the second recognition result and the modified entity recognition result of the first recognition result to obtain a fused entity recognition result.
[0136] Optionally, step S62 includes:
[0137] S621, traversing the relationship recognition results of the second recognition result, and for each traversed relationship, performing the following steps respectively: if there is a relationship in the relationship recognition result of the first recognition result that has the same head entity and tail entity as the currently traversed relationship but a different relationship label, then modify the relationship label of the existing relationship in the first recognition result (that is, the relationship in the first recognition result that has the same head entity and tail entity as the currently traversed relationship but a different relationship label) to the label of the relationship in the relationship recognition result of the currently traversed second recognition result; otherwise, no processing is performed;
[0138] S622, based on step S621, obtaining a modified relationship recognition result of the first recognition result;
[0139] S623: Take the union of the relationship recognition result of the second recognition result and the modified relationship recognition result of the first recognition result to obtain a fused relationship recognition result.
[0140] Optionally, the training method of the deep model includes the following steps a to c.
[0141] Step a: construct the first training set.
[0142] The method for constructing the first training set includes:
[0143] Collect historical electronic medical records corresponding to the target disease, where the target disease is the disease corresponding to the target disease database;
[0144] Using the pre-set sentence segmentation rules, the collected texts of each historical electronic medical record are split into several sentences;
[0145] The entities and relations in each sentence obtained by the splitting are annotated; the entities are annotated, including the start position, end position, entity content and entity label of the entities; the relations are annotated, including the start entity, end entity and relationship label of the relations;
[0146] Collect all the labeled sentences to obtain the first training set.
[0147] It is understandable that the sentence division rule can be performed according to sentence division punctuation marks such as period, semicolon, etc. In specific implementation, those skilled in the art can manage these punctuation marks according to actual conditions, including adding and deleting punctuation marks for each sentence.
[0148] Step b: Model construction.
[0149] Step b specifically includes:
[0150] Build a global pointer model;
[0151] The weights of the constructed global pointer model are randomly initialized to obtain the initial depth model.
[0152] Step c: training the initial deep model using the first training set constructed in step a.
[0153] The specific training method of training the initial deep model using the first training set constructed in step a includes:
[0154] The data in the first training set is input into the initial deep model for iterative training. In each iterative training, the input data is converted into word vectors, and the logit score of each word vector is calculated. A prediction matrix is generated based on the calculated logit score of each word vector. The cross entropy loss function is then used to calculate the loss between the prediction matrix and the true label matrix corresponding to the data in the training set. The model gradient is then calculated based on the calculated loss through the back propagation algorithm, and the model parameters are updated using the Adam optimizer until the model converges or reaches a preset number of iterations. The training ends and a trained deep model is obtained.
[0155] Optionally, the training method of the machine learning model includes the following steps d to g.
[0156] Step d: Construction of training set.
[0157] The construction of the training set in step d includes constructing a second training set and constructing a third training set.
[0158] The construction method of the second training set includes:
[0159] Step d1, collect historical electronic medical records corresponding to the target disease;
[0160] Step d2: using a preset sentence segmentation rule to split the text of each collected historical electronic medical record into several sentences;
[0161] Step d3, traverse each sentence obtained in step d2, when traversing to the first sentence, store this sentence in a preset list of data to be labeled, and convert this sentence into a vector by using the TF-IDF algorithm, store it in the preset vector list, and then continue to traverse the next sentence; each time traversing to the next sentence, convert the next sentence traversed to a vector by using the TF-IDF algorithm, then calculate the cosine similarity between the vector and each vector in the vector list, and calculate the average value of the cosine similarity between the vector and each vector in the vector list, and then determine whether the average value is greater than or equal to a preset similarity mean threshold, if so, discard this sentence, if not, add the vector converted by the TF-IDF algorithm of this sentence to the vector list, and add this sentence to the list of data to be labeled, and so on, until all sentences obtained in step d2 are traversed;
[0162] Step d4, annotating the entities in each sentence in the list of data to be annotated finally obtained in step d3; wherein the entity is annotated, including the start position, end position, entity content and entity label of the annotated entity;
[0163] Step d5: collect all the sentences annotated in step d4 to obtain a second training set.
[0164] The construction method of the third training set includes:
[0165] Step d1', obtaining each sentence in the list of data to be annotated finally obtained in step d3;
[0166] Step d2', annotating the entities and relations in each sentence in the list of data to be annotated finally obtained in step d3;
[0167] Step d3': collect all the sentences annotated in step d2' to obtain a third training set.
[0168] e. Construction of the initial model.
[0169] Initial model construction, including:
[0170] e1. Construct a hidden Markov model, initialize the state probability vector, state transition probability matrix and observation probability matrix of the model by random initialization method, and obtain the initialized hidden Markov model;
[0171] e2. Build a Piece-Wise-CNN (PCNN) model, set the hyperparameters of the number of network layers and pooling method, and obtain the initial Piece-Wise-CNN model.
[0172] f. Hidden Markov model training steps include:
[0173] The data of the second training set is input into the initial hidden Markov model for iterative training. In each iterative training, the model generates a prediction matrix based on the model's state probability vector, state transition probability matrix and observation probability matrix, and calculates the loss based on the prediction matrix and the true label through the loss function. Then, the model gradient is calculated based on the calculated loss through the back propagation algorithm, and the state probability vector, state transition probability matrix and observation probability matrix are updated using the optimizer until the model converges or reaches a preset number of iterations. The training ends and a trained hidden Markov model is obtained.
[0174] The trained hidden Markov model is an entity recognition model that can recognize entities in input data.
[0175] g. Training steps of Piece-Wise-CNN model:
[0176] The text data of the third training set is input into the initial Piece-Wise-CNN model for iterative training. In each iterative training, the input text data is positionally encoded and converted into word vectors through the word embedding layer. The features of the input text data are then extracted based on the position encoding and word vectors through the convolutional layer. The relationships are then classified through the classifier to obtain the predicted probability distribution of various relationships in the input text data. The loss between the predicted probability distribution and the true label is then calculated through the cross entropy loss function model, and the model parameters are updated through back propagation according to the calculated loss until the model converges or reaches a preset number of iterations. The training ends and a trained Piece-Wise-CNN model is obtained.
[0177] The trained Piece-Wise-CNN model is a relationship recognition model that can identify relationships in input data.
[0178] The trained hidden Markov model and the trained Piece-Wise-CNN model constitute a trained machine learning model.
[0179] When using a pre-trained machine learning model to identify entities and relationships existing in the currently traversed target electronic medical record, the currently traversed target electronic medical record can be input into the trained hidden Markov model and the trained Piece-Wise-CNN model respectively.
[0180] The currently traversed target electronic medical record is input into the trained hidden Markov model, and the entity recognition result in the currently traversed target electronic medical record can be identified by the trained hidden Markov model.
[0181] The currently traversed target electronic medical record is input into the trained Piece-Wise-CNN model, and the trained Piece-Wise-CNN model can be used to identify the relationship recognition results in the currently traversed target electronic medical record.
[0182] The entity recognition results in the currently traversed target electronic medical record identified by the hidden Markov model and the relationship recognition results in the currently traversed target electronic medical record identified by the Piece-Wise-CNN model are combined, that is, a second recognition result is obtained by using a pre-trained machine learning model to recognize the entities and relationships in the currently traversed target electronic medical record.
[0183] The same entity label setting method is used in each training set involved in this specification. For example, the entity labels of the labeled entities in the training set of the machine learning model use the entity labels of the labeled entities in the training set of the deep model. For another example, the field labels used for field annotation in the target disease database use the entity labels of the labeled entities in the training set of the deep model.
[0184] It should also be noted that in the steps of constructing the first training set in step a and each training set in step d, the historical electronic medical records collected come from different medical institutions.
[0185] Optionally, each field of the target disease-specific database is equipped with a field label, and the field label of the target disease-specific database is set in the same way as the entity label.
[0186] Optionally, the method of extracting entities required for fields of the target disease database from the recognition results includes:
[0187] From the entity recognition results of the recognition results, find the entity whose entity content is related to the target disease as the first entity; the target disease is the disease corresponding to the target disease database;
[0188] Based on the relationship recognition results of the recognition results, all entities related to the first entity are found and used as second entities respectively;
[0189] Comparing the entity labels of the second entities with the field labels of the target disease database to see if they are the same;
[0190] All second entities whose entity tags are the same as the field tags of the target disease database are extracted, that is, all entities required for the fields of the target disease database extracted from the recognition results are obtained.
[0191] Preferably, the entity whose entity content is related to the target disease, ie, the entity whose entity content has a similarity with the target disease greater than a preset similarity threshold.
[0192] In specific implementation, the target disease is the name of the target disease.
[0193] In specific implementation, the name of the target disease can be one or more.
[0194] When the name of the target disease is one, the method for determining whether the entity content of an entity is related to the target disease is:
[0195] Calculate the similarity between the entity content of the entity and the name of the target disease;
[0196] Determine whether the calculated similarity is greater than a preset similarity threshold;
[0197] If so, it is determined that the entity content of the entity is related to the target disease;
[0198] If not, it is determined that the entity content of the entity is not relevant to the target disease.
[0199] When there are multiple names of target diseases, the method for determining whether the entity content of an entity is related to the target disease is as follows:
[0200] Calculate the similarity between the entity content of the entity and each name of the target disease;
[0201] Determine whether the calculated similarity values are greater than a preset similarity threshold:
[0202] If so, it is determined that the entity content of the entity is related to the target disease;
[0203] If not, it is determined that the entity content of the entity is not relevant to the target disease.
[0204] It can be understood that in a relationship in the relationship recognition result, the head entity and the tail entity are related.
[0205] The first entity and the second entity may constitute a head entity and a tail entity of a relationship.
[0206] The first entity can be the head entity in a relationship or the tail entity in a relationship.
[0207] If the first entity is the head entity in a relationship, then the entity related to the first entity is the tail entity in the same relationship;
[0208] If the first entity is the tail entity in a relationship, then the entity related to the first entity is the head entity in the same relationship.
[0209] Specifically, in step S4, the entity required for the field of the target disease database is extracted from the first recognition result, and the specific implementation method includes:
[0210] From the entity recognition results of the first recognition result, find an entity whose entity content is related to the target disease as the first entity;
[0211] Based on the relationship recognition result of the first recognition result, find all entities related to the first entity and use them as second entities respectively;
[0212] Comparing the entity labels of the second entities with the field labels of the target disease database to see if they are the same;
[0213] All second entities whose entity tags are the same as the field tags of the target disease database are extracted, that is, all entities required for the fields of the target disease database extracted from the first recognition result are obtained.
[0214] Specifically, in step S7, the entities required for the fields of the target disease database are extracted from the final recognition result. The specific implementation method includes:
[0215] From the entity recognition results of the final recognition result, find an entity whose entity content is related to the target disease as the third entity;
[0216] Based on the relationship recognition result of the final recognition result, find all entities related to the third entity and use them as fourth entities respectively;
[0217] Compare the entity labels of each fourth entity with the field labels of the target disease database to see if they are the same;
[0218] All fourth entities whose entity tags are the same as the field tags of the target disease-specific database are extracted, that is, all entities required for the fields of the target disease-specific database extracted from the final recognition result are obtained.
[0219] The target specific disease is the disease corresponding to the target specific disease database. In specific implementation, the target specific disease database is usually named after the target specific disease.
[0220] Optionally, in a specific implementation, whether the entities required for the fields of the target disease database can be extracted from the recognition results can be determined by judging whether the number of entities required for the fields of the target disease database extracted from the recognition results is 0, specifically:
[0221] If the number of entities required for the fields of the target disease database extracted from the recognition results is not 0, it is defined as the entities required for the fields of the target disease database to be extracted from the recognition results;
[0222] If the number of entities required for the fields of the target disease database extracted from the recognition result is 0, it is defined that the entities required for the fields of the target disease database cannot be extracted from the recognition result.
[0223] For example, if the number of entities required for the fields of the target special disease database extracted from the first recognition result is not 0, it is defined that the entities required for the fields of the target special disease database can be extracted from the first recognition result; if the number of entities required for the fields of the target special disease database extracted from the first recognition result is 0, it is defined that the entities required for the fields of the target special disease database cannot be extracted from the first recognition result.
[0224] For another example, if the number of entities required for the fields of the target special disease database extracted from the final recognition result is not 0, it is defined as the entities required for the fields of the target special disease database that can be extracted from the final recognition result; if the number of entities required for the fields of the target special disease database extracted from the final recognition result is 0, it is defined as the entities required for the fields of the target special disease database that cannot be extracted from the final recognition result.
[0225] Optionally, in step S9, the content of the extracted entity is written into a corresponding field of the target disease database, including:
[0226] Traverse each extracted entity and for each traversed entity, perform the following steps:
[0227] The content of the traversed entity is written into a field in the target disease database whose field label is the same as the label of the traversed entity.
[0228] Figure 2 An exemplary block diagram of the disease-specific database generation system of the present invention is shown.
[0229] like Figure 2 As shown, the system 200 includes:
[0230] The medical record input module 201 is used to input a target electronic medical record, where the target electronic medical record is an electronic medical record used to generate a target disease-specific database; the target disease-specific database is a disease-specific database to be generated;
[0231] The first traversal module 202 is used to traverse each input target electronic medical record;
[0232] A first recognition module 203 is used to recognize entities and relationships in the currently traversed target electronic medical record through a pre-trained deep model to obtain a first recognition result;
[0233] The first extraction module 204 is used to extract the entities required by the fields of the target disease database from the first recognition result: if the entities required by the fields of the target disease database can be extracted, the contents of the extracted entities are written into the corresponding fields of the target disease database, and then the next target electronic medical record is traversed and the first recognition module 203 is called until all target electronic medical records input by the medical record input module 201 are traversed; if the entities required by the fields of the target disease database cannot be extracted, the second recognition module 205 is called;
[0234] The second recognition module 205 is used to use a pre-trained machine learning model to identify entities and relationships in the currently traversed target electronic medical record, obtain a second recognition result, and then call the fusion module 206;
[0235] A fusion module 206 is used to fuse the first recognition result and the second recognition result to obtain a final recognition result corresponding to the currently traversed target electronic medical record;
[0236] The second extraction module 207 is used to extract the entities required by the fields of the target disease database from the final recognition result: if the entities required by the fields of the target disease database can be extracted, the data writing module is called; otherwise, a new training set is constructed by sampling from all target electronic medical records input by the medical record input module 201 to retrain the machine learning model, and a trained new machine learning model is obtained, and then the third recognition module 208 is called;
[0237] The third recognition module 208 is used to use the new machine learning model newly trained in the second extraction module 207 to identify entities and relationships in the currently traversed target electronic medical record, obtain a new second recognition result, and then use the new second recognition result to replace the second recognition result obtained by using the machine learning model to identify the currently traversed target electronic medical record, and then call the fusion module 206;
[0238] The data writing module 209 is used to write the content of the extracted entity into the corresponding field of the target disease database, and is also used to continue traversing the next target electronic medical record and replace the pre-trained machine learning model with the new machine learning model most recently trained in the second extraction module 207, and then call the first recognition module 203 until all target electronic medical records input by the medical record input module 201 are traversed.
[0239] Figure 3 A schematic diagram of the structure of a terminal 300 provided in an embodiment of the present invention, wherein the terminal 300 can be used for.
[0240] Specifically, the terminal 300 includes:
[0241] Processor 310;
[0242] The memory 320 is used to store execution instructions of the processor 310;
[0243] The processor 310 is configured to execute the method provided by the embodiment of the present invention.
[0244] The present invention also provides a computer storage medium 400, such as Figure 4 As shown, the computer storage medium 400 stores a program 410, and when the program 410 is executed, it may include part or all of the steps in each embodiment provided by the present invention.
[0245] The storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM).
[0246] The technical effects that can be achieved by this embodiment can be found in the above description and will not be repeated here.
[0247] The same and similar parts between the various embodiments in this specification can be referenced to each other.
[0248] The present invention helps to train a machine learning model based on on-site data from medical institutions when the deep model performs poorly, and improves and modifies the answers of the deep learning model through the machine learning model. This approach avoids the problem of high cost of retraining the deep model and makes the disease-specific library production system more flexible.
[0249] Although the present invention has been described in detail by referring to the accompanying drawings and in combination with the preferred embodiments, the present invention is not limited thereto. Without departing from the spirit and essence of the present invention, a person of ordinary skill in the art may make various equivalent modifications or substitutions to the embodiments of the present invention, and these modifications or substitutions shall be within the scope of the present invention. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed by the present invention, and all of these shall be within the scope of protection of the present invention. Therefore, the scope of protection of the present invention shall be subject to the scope of protection of the claims.
Claims
1. A method for generating a disease-specific database, characterized in that: include: S1. Input the target electronic medical record, which is the electronic medical record used to generate the target disease-specific database; The target disease-specific database is a disease-specific database to be generated; S2, traversing each input target electronic medical record; S3, identifying entities and relationships in the currently traversed target electronic medical record through a pre-trained deep model to obtain a first recognition result; S4. Extracting entities required for fields of the target disease database from the first recognition result: If the entity required by the field of the target disease database can be extracted, the content of the extracted entity is written into the corresponding field of the target disease database, and then the next target electronic medical record is traversed and the process goes to step S3 to continue until all target electronic medical records input in step S1 are traversed; If the entity required by the field of the target disease database cannot be extracted, step S5 is executed; S5, using a pre-trained machine learning model to identify entities and relationships in the currently traversed target electronic medical record, obtaining a second recognition result, and then executing S6; S6. Fusing the first recognition result and the second recognition result to obtain a final recognition result corresponding to the currently traversed target electronic medical record; S7, extracting entities required by the fields of the target disease database from the final recognition result: if the entities required by the fields of the target disease database can be extracted, executing step S9; otherwise, sampling from all target electronic medical records input in step S1 to construct a new training set to retrain the machine learning model, obtain a trained new machine learning model, and then execute step S8; S8, using the new machine learning model obtained by the latest training in step S7 to identify entities and relationships existing in the target electronic medical record currently traversed, to obtain a new second recognition result, and then using the new second recognition result to replace the second recognition result obtained by using the machine learning model to identify the target electronic medical record currently traversed, and then going to step S6 to continue execution; S9, write the content of the extracted entity into the corresponding field of the target disease database, then continue to traverse the next target electronic medical record, and use the new machine learning model newly trained in step S7 to replace the pre-trained machine learning model, and go to step S3 to continue execution until all target electronic medical records input in step S1 are traversed; Among them, the training method of the deep model is: Build a global pointer model; Randomly initialize the weights of the constructed global pointer model to obtain the initial depth model; Training the initial depth model to obtain a trained depth model; Training methods for machine learning models: Construct a hidden Markov model, initialize the model's state probability vector, state transition probability matrix and observation probability matrix by random initialization method, and obtain the initialized hidden Markov model; Build a Piece-Wise-CNN model, set the hyperparameters of the number of network layers and pooling method, and obtain the initial Piece-Wise-CNN model; Training the initial hidden Markov model to obtain a trained hidden Markov model; Training the initial Piece-Wise-CNN model to obtain a trained Piece-Wise-CNN model; The trained hidden Markov model and the trained Piece-Wise-CNN model constitute a trained machine learning model.
2. The method according to claim 1, characterized in that Step S6 includes: S61, fusing the entity recognition result of the first recognition result and the second recognition result to obtain a fused entity recognition result; S62, fusing the relationship recognition result of the first recognition result and the second recognition result to obtain a fused relationship recognition result; S63, collecting the fused entity recognition results and the fused relationship recognition results to obtain the final recognition result.
3. The method according to claim 2, characterized in that Step S61 includes: S611, traversing the entity recognition results of the second recognition result, and for each traversed entity, performing the following steps respectively: if there is an entity in the entity recognition result of the first recognition result that has the same starting position and ending position as the currently traversed entity and a different entity label, then modifying the label of the existing entity in the first recognition result to the label of the entity in the entity recognition result of the currently traversed second recognition result; otherwise, no processing is performed; S612, based on step S611, obtaining a modified entity recognition result of the first recognition result; S613: Take a union of the entity recognition result of the second recognition result and the modified entity recognition result of the first recognition result to obtain a fused entity recognition result.
4. The method according to claim 2, characterized in that: Step S62 includes: S621, traversing the relationship recognition results of the second recognition result, and for each traversed relationship, performing the following steps respectively: if there is a relationship in the relationship recognition result of the first recognition result that has the same head entity and tail entity as the currently traversed relationship but a different relationship label, then modify the label of the existing relationship in the first recognition result to the label of the relationship in the relationship recognition result of the currently traversed second recognition result; otherwise, no processing is performed; S622, based on step S621, obtaining a modified relationship recognition result of the first recognition result; S623: Take the union of the relationship recognition result of the second recognition result and the modified relationship recognition result of the first recognition result to obtain a fused relationship recognition result.
5. The method according to claim 1, characterized in that The training methods of deep models specifically include: a. Constructing a first training set; the method for constructing the first training set includes: Collect historical electronic medical records corresponding to the target disease, where the target disease is the disease corresponding to the target disease database; Using the pre-set sentence segmentation rules, the collected texts of each historical electronic medical record are split into several sentences; The entities and relations in each sentence obtained by the splitting are annotated; the entities are annotated, including the start position, end position, entity content and entity label of the entities; the relations are annotated, including the start entity, end entity and relationship label of the relations; Collect all the labeled sentences to obtain the first training set; b. Model construction: Constructing the initial depth model; c. Using the first training set to train the initial depth model, the specific training method includes: The data in the first training set is input into the initial deep model for iterative training. In each iterative training, the input data is converted into word vectors, and the logit score of each word vector is calculated. A prediction matrix is generated based on the calculated logit score of each word vector. The cross entropy loss function is then used to calculate the loss between the prediction matrix and the true label matrix corresponding to the data in the training set. The model gradient is then calculated based on the calculated loss through the back propagation algorithm, and the model parameters are updated using the Adam optimizer until the model converges or reaches a preset number of iterations. The training ends and a trained deep model is obtained.
6. The method according to claim 1, characterized in that The training methods of machine learning models specifically include: d. constructing a training set; the construction of the training set includes constructing a second training set and a third training set; The construction method of the second training set includes: Step d1, collect historical electronic medical records corresponding to the target disease; Step d2: using a preset sentence segmentation rule to split the text of each collected historical electronic medical record into several sentences; Step d3, traverse each sentence obtained in step d2, when traversing to the first sentence, store this sentence in a preset list of data to be labeled, and convert this sentence into a vector by using the TF-IDF algorithm, store it in the preset vector list, and then continue to traverse the next sentence; each time traversing to the next sentence, convert the next sentence traversed to a vector by using the TF-IDF algorithm, then calculate the cosine similarity between the vector and each vector in the vector list, and calculate the average value of the cosine similarity between the vector and each vector in the vector list, and then determine whether the average value is greater than or equal to a preset similarity mean threshold, if so, discard this sentence, if not, add the vector converted by the TF-IDF algorithm of this sentence to the vector list, and add this sentence to the list of data to be labeled, and so on, until all sentences obtained in step d2 are traversed; Step d4, annotating the entities in each sentence in the list of data to be annotated finally obtained in step d3; wherein the entity is annotated, including the start position, end position, entity content and entity label of the annotated entity; Step d5, collect all the sentences marked in step d4 to obtain the second training set; The construction method of the third training set includes: Step d1', obtaining each sentence in the list of data to be annotated finally obtained in step d3; Step d2', annotating the entities and relations in each sentence in the list of data to be annotated finally obtained in step d3; Step d3', collect all the sentences annotated in step d2' to obtain a third training set; e. Construction of initial model: Constructing the initialized hidden Markov model; Constructing the initial Piece-Wise-CNN model; f. Hidden Markov model training: The data of the second training set is input into the initial hidden Markov model for iterative training. In each iterative training, the model generates a prediction matrix based on the state probability vector, state transition probability matrix and observation probability matrix of the model, and calculates the loss based on the prediction matrix and the true label through the loss function. Then, the model gradient is calculated through the back propagation algorithm based on the calculated loss, and the state probability vector, state transition probability matrix and observation probability matrix are updated using the optimizer until the model converges or reaches a preset number of iterations. The training ends and a trained hidden Markov model is obtained; the trained hidden Markov model is an entity recognition model; g. Piece-Wise-CNN model training: The text data of the third training set is input into the initial Piece-Wise-CNN model for iterative training. In each iterative training, the input text data is positionally encoded and converted into word vectors through the word embedding layer. The features of the input text data are then extracted based on the position encoding and word vectors through the convolutional layer. The relationship is then classified through the classifier to obtain the predicted probability distribution of various relationships in the input text data. The loss between the predicted probability distribution and the true label is then calculated through the cross entropy loss function model, and the model parameters are updated through back propagation according to the calculated loss until the model converges or reaches a preset number of iterations. The training ends and a trained Piece-Wise-CNN model is obtained. The trained Piece-Wise-CNN model is a relationship recognition model.
7. The method according to claim 1, characterized in that Each field of the target disease database is equipped with a field label; the field label of the target disease database is set in the same way as the entity label; Methods for extracting entities required for fields of the target disease database from the recognition results include: From the entity recognition results of the recognition results, find the entity whose entity content is related to the target disease as the first entity; the target disease is the disease corresponding to the target disease database; Based on the relationship recognition results of the recognition results, all entities related to the first entity are found and used as second entities respectively; Comparing whether the entity label of each second entity is the same as the field label of the target disease database; All second entities whose entity tags are the same as the field tags of the target disease database are extracted, and all entities required for the fields of the target disease database extracted from the recognition results are obtained.
8. A disease-specific database generation system, characterized in that: The system includes: A medical record input module, used to input a target electronic medical record, where the target electronic medical record is an electronic medical record used to generate a target disease-specific database; The target disease-specific database is a disease-specific database to be generated; The first traversal module is used to traverse each input target electronic medical record; A first recognition module is used to recognize entities and relationships in the currently traversed target electronic medical record through a pre-trained deep model to obtain a first recognition result; The first extraction module is used to extract the entities required by the fields of the target disease database from the first recognition result: if the entities required by the fields of the target disease database can be extracted, the contents of the extracted entities are written into the corresponding fields of the target disease database, and then the next target electronic medical record is traversed and the first recognition module is called until all target electronic medical records input by the medical record input module are traversed; if the entities required by the fields of the target disease database cannot be extracted, the second recognition module is called; The second recognition module is used to use a pre-trained machine learning model to identify entities and relationships in the target electronic medical record currently traversed, obtain a second recognition result, and then call the fusion module; A fusion module, used to fuse the first recognition result and the second recognition result to obtain a final recognition result corresponding to the target electronic medical record currently traversed; A second extraction module is used to extract entities required for the fields of the target disease database from the final recognition result: if the entities required for the fields of the target disease database can be extracted, a data writing module is called; Otherwise, a new training set is constructed by sampling from all target electronic medical records input by the medical record input module to retrain the machine learning model, thereby obtaining a trained new machine learning model, and then the third recognition module is called; A third recognition module is used to use the new machine learning model newly trained in the second extraction module to identify entities and relationships in the currently traversed target electronic medical record, obtain a new second recognition result, and then use the new second recognition result to replace the second recognition result obtained by using the machine learning model to identify the currently traversed target electronic medical record, and then call the fusion module; A data writing module is used to write the content of the extracted entity into the corresponding field of the target disease database, and is also used to continue to traverse the next target electronic medical record and replace the pre-trained machine learning model with the new machine learning model most recently trained in the second extraction module, and then call the first recognition module until all target electronic medical records input by the medical record input module are traversed; Among them, the training method of the deep model is: Build a global pointer model; Randomly initialize the weights of the constructed global pointer model to obtain the initial depth model; Training the initial depth model to obtain a trained depth model; Training methods for machine learning models: Construct a hidden Markov model, initialize the model's state probability vector, state transition probability matrix and observation probability matrix by random initialization method, and obtain the initialized hidden Markov model; Build a Piece-Wise-CNN model, set the hyperparameters of the number of network layers and pooling method, and obtain the initial Piece-Wise-CNN model; Training the initial hidden Markov model to obtain a trained hidden Markov model; Training the initial Piece-Wise-CNN model to obtain a trained Piece-Wise-CNN model; The trained hidden Markov model and the trained Piece-Wise-CNN model constitute a trained machine learning model.
9. A terminal, characterized in that: include: processor; A memory for storing execution instructions of the processor; The processor is configured to execute the method according to any one of claims 1 to 7.
10. A computer-readable storage medium storing a computer program, characterized in that: When the program is executed by a processor, the method described in any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Electronic medical record named entity identification method and system fusing deep learning and rules
CN112001177A
Medical special disease database generation method and device, equipment and medium
CN118468873A