Entity recognition method, device, equipment and medium based on deep learning model
Through the entity recognition method based on deep learning model, combined with natural language reasoning and recall technology, the problem of discontinuous and parallel disease entity recognition in medical texts is solved, the accuracy and efficiency of disease entity recognition are improved, and automated processing is realized.
Patent Information
- Application Number
- CN202010929008.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-09-07
- Publication Date
- 2025-01-10
- Estimated Expiration
- 2040-09-07
AI Technical Summary
The prior art cannot effectively identify discontinuous and parallel disease entities in medical texts in the medical field, resulting in low accuracy of disease entity recognition.
The entity recognition method based on deep learning model is adopted, and disease entity annotation and recalling the training set, and a preset entity recognition model is established in combination with natural language reasoning, which improves the model's recognition ability of discontinuous and parallel disease entities.
The accuracy of disease entity recognition is improved, so that the preset entity recognition model can effectively identify discontinuous and parallel disease entities from the medical text to be identified, simplifying the recognition process, eliminating the entity linking steps, and realizing automated processing.
Smart Images

Figure CN112016311B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of smart medical technology, and in particular to an entity recognition method, device, equipment and medium based on a deep learning model. Background Art
[0002] Knowledge graph is one of the most popular applications in the field of natural language and can be applied to multiple fields such as intelligent question answering and search engines. In the medical field, by constructing a medical knowledge graph, the complex relationship between diseases and treatment methods can be constructed into a database through the knowledge graph, thus providing medical staff with a good auxiliary diagnosis method. The construction of the medical knowledge graph requires the automatic acquisition of the disease entities involved in the text from the unstructured medical text, and then the construction of the medical knowledge graph is completed based on the disease entities and their related relationships.
[0003] In the existing technology, entities are extracted from text in the form of a pipeline mainly through two basic natural language processing technologies, entity recognition and entity linking. Among them, the mainstream entity recognition technology is to convert the text into a sequence labeling task, obtain the corresponding mentions of the entity in the text by annotating the text sequence with BIO, and then perform entity linking on the entity mentions according to the model to identify and map the entity to the entity of the knowledge graph.
[0004] However, in the medical field, disease entities are mostly named by abbreviations and abbreviations, which leads to the variable mention of disease entities in medical texts, especially in drug instructions. For example, disease entities often appear in a discontinuous and parallel manner in drug instructions, that is, different disease entities appear in parallel in the same position, and the same disease entity is distributed in different positions in the text. Therefore, if the traditional BIO annotation method is used to perform disease entity recognition in medical texts, the obtained disease entity recognition effect is not good and the accuracy of disease entity recognition is low. Summary of the invention
[0005] The present invention provides an entity recognition method, device, equipment and medium based on a deep learning model to solve the problem in the prior art that discontinuous and parallel disease entities in medical texts cannot be recognized, resulting in low accuracy in disease entity recognition.
[0006] An entity recognition method based on a deep learning model, comprising:
[0007] Obtaining medical text to be recognized;
[0008] Input the medical text to be recognized into a preset entity recognition model, wherein the preset entity recognition model is an entity recognition model obtained by training according to a training set and a recall result of the training set, wherein the training set is a medical text training set in which disease entities mentioned in different ways in each medical text are annotated, and the recall result of the training set is a processing result of recalling each medical text according to all disease entities in the medical text;
[0009] Obtaining an entity recognition result output by the preset entity recognition model;
[0010] The entity recognition result is used as the disease entity mentioned in the medical text to be recognized, and the disease entity is output.
[0011] An entity recognition device based on a deep learning model, comprising:
[0012] A first acquisition module is used to acquire the medical text to be recognized;
[0013] An input module, used for inputting the medical text to be recognized into a preset entity recognition model, wherein the preset entity recognition model is an entity recognition model obtained by training according to a training set and a recall result of the training set, wherein the training set is a medical text training set in which disease entities mentioned in different ways in each medical text are annotated, and the recall result of the training set is a processing result of recalling each medical text according to all disease entities in the medical text;
[0014] A second acquisition module is used to obtain the entity recognition result output by the preset entity recognition model;
[0015] An output module is used to use the entity recognition result as the disease entity mentioned in the medical text to be recognized, and output the disease entity.
[0016] A computer device comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above-mentioned entity recognition method based on a deep learning model when executing the computer program.
[0017] A readable storage medium stores a computer program, which, when executed by a processor, implements the steps of the above-mentioned entity recognition method based on a deep learning model.
[0018] In a solution provided by the above-mentioned entity recognition method, device, equipment and medium based on deep learning model, by obtaining the medical text to be recognized, the medical text to be recognized is input into a preset entity recognition model, the preset entity recognition model is an entity recognition model obtained by training according to the training set and the recall result of the training set, the training set is a medical text training set in which the disease entities mentioned in different ways in each medical text are annotated, and the recall result of the training set is the processing result of recalling each medical text according to all disease entities in each medical text, and then the entity recognition result output by the preset entity recognition model is obtained, and finally the entity recognition result is used as the disease entity mentioned in the medical text to be recognized, and the disease entity is output; in the present invention, by annotating and recalling the disease entity of the training set, a preset entity recognition model is established by using the recall + natural language reasoning method, which improves the disease entity recognition ability of the preset entity recognition model to recognize medical texts that mention disease entities in different ways, so that the preset entity recognition model can effectively recognize discontinuous and parallel disease entities from the medical text to be recognized, solves the problem of being unable to recognize discontinuous and parallel disease entities in the medical text, thereby improving the accuracy of disease entity recognition. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative labor.
[0020] Figure 1 It is a schematic diagram of an application environment of an entity recognition method based on a deep learning model in one embodiment of the present invention;
[0021] Figure 2 It is a flow chart of an entity recognition method based on a deep learning model in one embodiment of the present invention;
[0022] Figure 3 is a schematic diagram of a process for obtaining a preset entity recognition model in one embodiment of the present invention;
[0023] Figure 4 yes Figure 3 A schematic diagram of an implementation process of step S20;
[0024] Figure 5 yes Figure 3 A schematic diagram of an implementation process of step S30;
[0025] Figure 6 yes Figure 3 A schematic diagram of an implementation process of step S40;
[0026] Figure 7 yes Figure 3 A schematic diagram of an implementation process of step S50;
[0027] Figure 8 is a structural schematic diagram of an entity recognition device based on a deep learning model in one embodiment of the present invention;
[0028] Fig. 9 It is a structural diagram of a computer device in one embodiment of the present invention. DETAILED DESCRIPTION
[0029] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. 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.
[0030] The entity recognition method based on the deep learning model provided by the embodiment of the present invention can be applied in the following aspects: Figure 1 In an application environment, the terminal device communicates with the server through a network. The server obtains the medical text to be identified from the terminal device, and inputs the medical text to be identified into a preset entity recognition model. The preset entity recognition model is an entity recognition model obtained by training according to a training set and the recall result of the training set. The training set is a medical text training set that marks the disease entities mentioned in different ways in each medical text. The recall result of the training set is the result of recalling each medical text according to all disease entities in each medical text, and then obtains the entity recognition result output by the preset entity recognition model. Finally, the entity recognition result is used as the disease entity mentioned in the medical text to be identified, and the disease entity is output, so that the preset entity recognition model can effectively identify discontinuous and parallel disease entities from the medical text to be identified, thereby improving the accuracy of disease entity recognition.
[0031] The terminal device may be, but is not limited to, various personal computers, laptops, smart phones, tablet computers, and portable wearable devices. The server may be implemented as an independent server or a server cluster consisting of multiple servers.
[0032] In this embodiment, the obtained medical text to be identified, the preset entity recognition model, the entity recognition results, the output disease entity and its related data are all stored in the blockchain database of the server. Blockchain is a new application mode of computer technologies such as distributed data storage, point-to-point transmission, consensus mechanism, encryption algorithm, etc. Blockchain is essentially a decentralized database. It is a string of data blocks generated by cryptographic methods. Each data block contains a batch of network transaction information, which is used to verify the validity of its information (anti-counterfeiting) and generate the next block. The blockchain can include the underlying blockchain platform, the platform product service layer, and the application service layer. In this embodiment, the preset brain tumor segmentation model and related data are stored in the blockchain network, which is convenient for rapid query of the target model and data and improves the processing speed.
[0033] In one embodiment, if Figure 2 As shown, a method for entity recognition based on a deep learning model is provided. The method is applied in Figure 1 The server in the example is used as an example to illustrate the process, including the following steps:
[0034] S01: Obtain medical text to be recognized.
[0035] Obtaining the medical text to be identified, that is, obtaining the medical text from which the disease entity needs to be extracted from the text summary, so as to subsequently identify and output the disease entity based on the medical text to be identified. The medical text to be identified is a medical text that mentions the disease entity in different ways, that is, the medical text to be identified can be a medical text that mentions the disease entity in a parallel and discontinuous manner, or a medical text that mentions the disease entity in a continuous and independent manner.
[0036] S02: Input the medical text to be recognized into a preset entity recognition model. The preset entity recognition model is an entity recognition model obtained by training according to a training set and the recall result of the training set. The training set is a medical text training set that marks the disease entities mentioned in different ways in each medical text. The recall result of the training set is the processing result of recalling each medical text according to all disease entities in each medical text.
[0037] After obtaining the medical text to be identified, the medical text to be identified is input into a preset entity recognition model so that the preset entity recognition model performs disease entity recognition on the medical text to be identified. The preset entity recognition model is an entity recognition model obtained by training according to a training set and the recall result of the training set. The training set is a medical text training set that marks the disease entities mentioned in different ways in each medical text. The recall result of the training set is the result of recalling each medical text according to all the disease entities in each medical text. The medical texts that mention disease entities in different ways include medical texts that mention disease entities in a parallel and discontinuous manner, and also include medical texts that mention disease entities in a continuous and independent manner.
[0038] Unlike traditional recognition models, in the process of constructing a preset entity recognition model, it is necessary to perform disease entity annotation based on natural language reasoning on the medical texts in the training set, that is, to annotate all disease entities mentioned in each medical text in the training set, and to perform recall processing on the annotated training set, that is, to perform word segmentation processing on the disease entities mentioned in each medical text to obtain the word segmentation of the disease entity, and to obtain the disease entity associated with the word segmentation of the disease entity in the existing disease entities as a candidate disease entity. Then, each medical text determines whether the candidate disease entity is the actual disease entity of the medical text based on the disease entity mentioned in the annotated medical text in the training set, and annotates the candidate disease entity corresponding to each medical text according to the determination result to obtain the recall result of each medical text, and summarizes the recall result of each medical text to obtain the recall result of the training set, thereby improving the recall rate of the training set and thus improving the accuracy of the model. The preset entity recognition model established by the method of recall + natural language reasoning has a good recall rate and recognition ability for the medical text to be recognized, and can effectively recognize the disease entities that appear discontinuously and in parallel in the medical text to be recognized.
[0039] For example, the medical text is that patients with type 2 diabetes should reduce the dosage of this product, and patients with type 2 diabetes accompanied by ketoacidosis are prohibited from using this product. In this case, there are two disease entities in the text: type 2 diabetes and type 2 diabetes accompanied by ketoacidosis. Both type 2 diabetes and type 2 diabetes accompanied by ketoacidosis are disease entities mentioned in the text summary in a continuous and independent manner. The medical text is: The dosage of this product should be reduced when used for type 1 or type 2 diabetes, but it is prohibited for people with ketoacidosis to use this product. There are four disease entities in the text: type 1 diabetes, type 2 diabetes, type 1 diabetes with ketoacidosis, and type 2 diabetes with ketoacidosis. Among them, type 1 diabetes and type 2 diabetes appear in parallel in the text, type 1 diabetes with ketoacidosis and type 2 diabetes with ketoacidosis appear in a discontinuous manner in the text. The traditional recognition model can only recognize type 1 diabetes and type 2 diabetes, but cannot recognize all four disease entities. The preset entity recognition model obtained by accurately annotating the disease entities of each medical text in the training set and recalling the training set before training the model has good recognition ability for medical texts and can effectively recognize the four disease entities in the medical text to be recognized.
[0040] In this embodiment, the medical text to be identified is that the dosage of this product should be reduced when used for type 1 or type 2 diabetes, but this product is prohibited for use by patients with ketoacidosis. This is only an exemplary description. In other embodiments, the medical text to be identified may also be other texts, which will not be repeated here.
[0041] S03: Obtaining entity recognition results output by a preset entity recognition model.
[0042] After the medical text to be recognized is input into the preset entity recognition model, an entity recognition result for the medical text to be recognized output by the preset entity recognition model is obtained.
[0043] S04: Use the entity recognition result as the disease entity mentioned in the medical text to be identified, and output the disease entity.
[0044] After obtaining the entity recognition result output by the preset entity recognition model, the entity recognition result is used as the disease entity mentioned in the medical text to be recognized, and the disease entity is output so that corresponding processing can be performed later according to the output disease entity.
[0045] For example, medical texts may include drug instructions, disease diagnosis reports, medical records, and medical literature. After identifying disease entities in medical texts, the output disease entities may be processed differently according to the type of medical text, including constructing a medical database based on a knowledge graph or constructing corresponding diagnosis and treatment plans based on the disease entities.
[0046] In this embodiment, the medical text may be a drug instruction sheet, a disease diagnosis report, a medical record, a medical literature, etc., which is only an exemplary description. In other embodiments, the medical text may also be other types of text, which will not be described in detail here.
[0047] In this embodiment, constructing a medical database based on a knowledge graph or constructing a corresponding diagnosis and treatment plan according to disease entities is only for illustrative purposes. In other embodiments, other processing may be performed on the output disease entities, which will not be repeated here.
[0048] In addition, after the present embodiment uses the preset entity recognition model to identify the disease entity mentioned in the medical text to be identified, the disease entity can be directly output as an application. In the traditional recognition method, it is necessary to first identify the mention of the disease entity from the medical text, and then use entity linking to link the mention of the disease entity to the standard medical name of the disease entity. For example, in the medical text that the dosage of this product should be reduced for type 1 diabetes, it is necessary to first extract the mention of the disease entity: type 1 diabetes, and then use entity linking technology to link it to the standard medical name of type 1 diabetes: type 1 diabetes. Finally, the obtained disease entity is processed. In this embodiment, this article proposes an entity recognition method based on a deep learning model, which can directly identify the disease entity in the medical text to be identified: type 1 diabetes, and output it accurately, eliminating the entity linking step, and converting the traditional entity recognition + entity linking pipeline form into an end-to-end form, realizing the automated processing process of artificial intelligence + entity extraction, and obtaining accurate disease recognition results without human participation, thereby improving the recognition efficiency and recognition ability of disease entities.
[0049] In a solution provided by the above-mentioned entity recognition method, device, equipment and medium based on deep learning model, by obtaining the medical text to be recognized, the medical text to be recognized is input into a preset entity recognition model, the preset entity recognition model is an entity recognition model obtained by training according to a training set and the recall result of the training set, the training set is a medical text training set in which the disease entities mentioned in different ways in each medical text are annotated, the recall result of the training set is the processing result of recalling each medical text according to all disease entities in each medical text, and then the entity recognition result output by the preset entity recognition model is obtained, and finally the entity recognition The identification results are used as the disease entities mentioned in the medical text to be identified, and the disease entities are output; in this embodiment, by annotating and recalling the medical texts in the training set for disease entities, a preset entity recognition model is established by adopting the method of recall + natural language reasoning, thereby improving the recall rate of the preset entity recognition model and the disease entity recognition ability of the medical texts that mention the disease entities in different ways, so that the preset entity recognition model can effectively identify discontinuous and parallel disease entities from the medical text to be identified, thereby solving the problem of being unable to identify discontinuous and parallel disease entities in the medical text, thereby improving the accuracy of disease entity recognition.
[0050] In one embodiment, a preset entity recognition model is input into the medical text to be recognized, and a preset entity recognition model needs to be trained in advance, such as Figure 3 As shown, step S10, i.e., the process of obtaining the preset entity recognition model, specifically includes the following steps:
[0051] S10: Determine a training set and a test set of a preset entity recognition model based on existing medical texts.
[0052] First, multiple medical texts already in the medical database are obtained, and disease entity annotation is performed on some of the multiple medical texts, that is, the disease entities contained in the medical texts are extracted and annotated, and the annotated medical texts are used as training sets for the preset entity recognition model, and the medical texts without disease entity annotation are used as test sets for the preset entity recognition model, so that the preset entity recognition model can be obtained by subsequent training based on the training set and the test set.
[0053] Among them, the medical database is a database established based on existing medical texts. The medical database collects a large amount of medical texts and existing disease entities. Currently, there are approximately 88,000 existing disease entities.
[0054] S20: Using a search server to search for multiple candidate disease entities corresponding to each medical text in the training set, where the candidate disease entities are disease entities whose name segmentations appear in the medical text.
[0055] After the training set is determined, the search server is used to search for multiple candidate disease entities corresponding to each medical text in the training set, wherein the candidate disease entity is a disease entity whose name segmentation appears in the medical text. That is, according to the logic of natural language, the name of the existing disease entity is segmented, and a mapping relationship between the segmentation and the disease entity is established in the search server. Then, each medical text is input into the search server, and a search is performed based on the correlation between the medical text and the existing disease entity to obtain the subsequent disease entity corresponding to each medical text.
[0056] For example, the search server may be elasticsearch, which uses the principle of inverted index to name an existing disease entity as type 1 diabetes, segment type 1 diabetes, and obtain two segmented words, type 1 and diabetes. Type 1 and diabetes are mapped to type 1 diabetes respectively. If the medical text input to elasticsearch contains the two fields of type 1 or diabetes, type 1 diabetes is used as a candidate entity of the medical text.
[0057] In this embodiment, the search server may be elasticsearch for exemplary purposes only. In other embodiments, the search server may be other types, which will not be described in detail here.
[0058] In this embodiment, the names of disease entities are segmented according to the logic of natural language, and then search and match are performed to obtain candidate disease entities. Since the medical text and the candidate disease entities have common segmentations, the disease entities mentioned in the medical text must exist among the multiple candidate entities, thereby improving the recall rate of the training set.
[0059] S30: Labeling the corresponding multiple candidate disease entities according to each medical text in the training set to obtain a recall result of the training set.
[0060] After searching for multiple candidate disease entities corresponding to each medical text in the training set using the search server, the corresponding multiple candidate disease entities are labeled according to each medical text in the training set, that is, whether the searched candidate disease entity is the disease entity mentioned in each medical text, and the candidate disease entity of each medical text is labeled as a positive or negative example according to the determination result, so as to obtain the recall result of the training set. The purpose of this step is to perform recall processing on the medical texts in the training set to improve the recall rate of the training set, thereby improving the accuracy of the subsequent training model.
[0061] S40: A binary classification model is obtained by training according to the training set and the recall result of the training set.
[0062] After obtaining the recall results of the training set, a binary classification model is trained based on the training set and the recall results of the training set.
[0063] S50: Determine a preset entity recognition model according to the test set and the binary classification model.
[0064] After the binary classification model is trained based on the training set and the recall results of the training set, the binary classification model is used to predict disease entities on the test set to determine the accuracy of the prediction results, thereby determining the preset entity recognition model based on the accuracy of the prediction results.
[0065] In this embodiment, a training set and a test set of a preset entity recognition model are determined based on existing medical texts, and then a search server is used to search for multiple candidate disease entities corresponding to each medical text in the training set, and the corresponding multiple candidate disease entities are labeled according to each medical text in the training set to obtain the recall result of the training set, and then a binary classification model is trained based on the training set and the recall result of the training set, and finally, the preset entity recognition model is determined based on the test set and the binary classification model, the acquisition process of the preset entity recognition model is clarified, and the preset entity recognition model is constructed by natural language reasoning + recall, which improves the recognition accuracy of the preset entity recognition model.
[0066] In one embodiment, if Figure 4 As shown, in step S20, the search server is used to search for multiple candidate disease entities corresponding to each medical text in the training set, which specifically includes the following steps:
[0067] a. Obtain the names of existing disease entities in medicine.
[0068] b. Perform word segmentation on the name of each disease entity to obtain multiple word segments of each disease entity.
[0069] c. Use the search server to determine whether each medical text in the training set contains the segmentation of the disease entity.
[0070] d. If the medical text contains the segmentation of the disease entity, the disease entity is taken as the candidate disease entity of the medical text.
[0071] e. Repeat steps cd until a preset number of candidate disease entities in the medical text are determined.
[0072] f. Repeat steps ce until candidate disease entities for all medical texts in the training set are obtained.
[0073] After using the search server to determine whether each medical text in the training set contains the segmentation of the disease entity, if the medical text does not contain the segmentation of the disease entity, the disease entity is not a candidate disease entity of the medical text.
[0074] For example, the name of the disease entity is type 1 diabetes. Type 1 diabetes is segmented to obtain two segmented words, type 1 and diabetes. The medical texts in the training set are input into the search server one by one to determine whether each medical text contains any one of the segmented words type 1 and diabetes. If the medical text contains both the fields type 1 or diabetes, type 1 diabetes is taken as a candidate entity of the medical text. After that, the name segmented words of other disease entities are searched and judged until it is determined that each medical text has a preset number of candidate disease entities. Finally, it is determined that each medical text in the training set has a preset number of candidate disease entities.
[0075] In one embodiment, the preset number may be 100, that is, each medical text in the training set has 100 candidate disease entities. In this embodiment, the preset number of 100 is only for exemplary purposes. In other embodiments, the preset number may also be other values, which will not be repeated here.
[0076] Since there are approximately 88,000 existing disease entities, if each medical text in the training set is searched and matched with all disease entities, the workload will be too large and the recall efficiency will be low. In this embodiment, each medical text in the training set is matched with a preset number of candidate disease entities, which reduces the workload, improves the efficiency of the training set recall processing, and thereby improves the efficiency of the preset entity recognition model.
[0077] In this embodiment, by obtaining the names of existing disease entities in medicine, the names of each disease entity are segmented to obtain multiple segmentations of each disease entity, and a search server is used to determine whether each medical text in the training set contains the segmentation of the disease entity. If the medical text contains the segmentation of any disease entity, the disease entity is used as a candidate disease entity for the medical text, and a preset number of candidate disease entities for the medical text are determined. Finally, candidate disease entities for all medical texts in the training set are obtained, and the specific steps of using the search server to search for multiple candidate disease entities corresponding to each medical text in the training set are refined. By matching a preset number of candidate disease entities for each medical text in the training set, the workload is reduced and the efficiency of the recall processing of the training set is improved while ensuring the recall rate of the training set, thereby improving the efficiency of the preset entity recognition model.
[0078] In one embodiment, if Figure 5 As shown, in step S30, the corresponding multiple candidate disease entities are labeled according to each medical text in the training set, which specifically includes the following steps:
[0079] S31: Determine whether the candidate disease entity is a disease entity mentioned in each medical text.
[0080] After matching multiple candidate disease entities for each medical text in the training set, the disease entity annotation results of each medical text in the root training set are obtained, and the disease entity annotation results of the medical text are determined based on the determination results of whether the candidate disease entity is the disease entity mentioned in each medical text.
[0081] S32: If the candidate disease entity is a disease entity mentioned in each medical text, the candidate disease entity is marked as a positive example.
[0082] After determining whether the candidate disease entity is a disease entity mentioned in each medical text, if it is determined that the candidate disease entity is a disease entity mentioned in each medical text based on the disease entity annotation results of the medical text, the candidate disease entity is annotated as a positive example.
[0083] S33: If the candidate disease entity is not a disease entity mentioned in each medical text, the candidate disease entity is marked as a negative example.
[0084] After determining whether the candidate disease entity is a disease entity mentioned in each medical text, if it is determined based on the disease entity annotation results of the medical text that the candidate disease entity is not a disease entity mentioned in each medical text, the candidate disease entity is annotated as a negative example.
[0085] For example, the medical text is: The dosage of this product should be reduced when used for type 1 or type 2 diabetes, but it is forbidden to use this product for patients with ketoacidosis. The disease entity annotation results of this medical text include type 1 diabetes, type 2 diabetes, type 1 diabetes with ketoacidosis, and type 2 diabetes with ketoacidosis. The multiple candidate disease entities corresponding to this medical text include type 1 diabetes, type 2 diabetes, secondary diabetes, and gestational diabetes. Among them, type 1 diabetes and type 2 diabetes are disease entities mentioned in this medical text, and type 1 diabetes and type 2 diabetes in the candidate disease entities are annotated as positive examples, annotated as 1; secondary diabetes and gestational diabetes are not disease entities mentioned in this medical text, and secondary diabetes and gestational diabetes in the candidate disease entities are annotated as negative examples, annotated as 0.
[0086] In this embodiment, the multiple candidate disease entities corresponding to the medical text include type 1 diabetes, type 2 diabetes, secondary diabetes and gestational diabetes for exemplary purposes only. In other embodiments, the multiple candidate disease entities corresponding to the medical text also include other related disease entities, which will not be repeated here.
[0087] After labeling each candidate disease entity, the candidate disease entity of each medical text and the labeling results corresponding to each candidate disease entity are used as the recall results of the training set.
[0088] After labeling each candidate disease entity, the labeling results corresponding to each candidate disease entity in the medical text are obtained, wherein the labeling results include positive examples and negative examples. Then, the candidate disease entities of each medical text and the labeling results corresponding to each candidate disease entity are used as the recall results of the training set, so that the model can be subsequently trained according to the candidate disease entities of each medical text in the training set and the labeling results corresponding to each candidate disease entity, thereby improving the recall rate and accuracy of the training model.
[0089] In this embodiment, by determining whether the candidate disease entity is the determination result of the disease entity mentioned in each medical text, if the candidate disease entity is the determination result of the disease entity mentioned in each medical text, the candidate disease entity is marked as a positive example; if the candidate disease entity is not the determination result of the disease entity mentioned in each medical text, the candidate disease entity is marked as a negative example. The process of labeling the corresponding multiple candidate disease entities according to each medical text in the training set is refined, providing a data basis for the subsequent training of the preset entity recognition model, thereby ensuring the recognition accuracy of the preset entity recognition model.
[0090] In one embodiment, if Figure 6 As shown, in step S40, a binary classification model is obtained by training according to the training set and the recall result of the training set, which specifically includes the following steps:
[0091] S41: The medical texts in the training set and the corresponding multiple candidate disease entities are input into the pre-training model in pairs.
[0092] After obtaining the recall results of the training set, the medical texts in the training set and the corresponding multiple candidate disease entities are input into the pre-training model in pairs.
[0093] The pre-trained model may be a BERT model. In this embodiment, the pre-trained model is described by taking the BERT model as an example. That is, after obtaining the recall result of the training set, the medical text is paired with each candidate disease, and the medical text is used as sentence A and the paired candidate disease is used as sentence B. The paired medical text is input into the pre-trained model in a paired form to predict whether the medical text of sentence A contains the candidate disease of sentence B.
[0094] For example, the medical text is "The dosage of this product should be reduced when used for type 1 or type 2 diabetes, but it is prohibited for patients with ketoacidosis". The multiple candidate disease entities corresponding to the medical text include type 1 diabetes, type 2 diabetes, secondary diabetes and gestational diabetes. "The dosage of this product should be reduced when used for type 1 or type 2 diabetes, but it is prohibited for patients with ketoacidosis" are paired with type 1 diabetes, type 2 diabetes, type 1 diabetes with ketoacidosis, and type 2 diabetes with ketoacidosis, respectively. Then, based on the pairing results, "The dosage of this product should be reduced when used for type 1 or type 2 diabetes, but it is prohibited for patients with ketoacidosis" is input into the pre-training model as sentence A, and type 1 diabetes, type 2 diabetes, secondary diabetes and gestational diabetes are input into the pre-training model one by one as sentence B to determine whether sentence B is contained in sentence A.
[0095] S42: Train the pre-trained model according to the recall result of the training set to obtain a binary classification model.
[0096] After the medical texts in the training set and the corresponding multiple candidate disease entities are input into the pre-training model in pairs, the pre-training model is trained according to the recall results of the training set to obtain a binary classification model.
[0097] Among them, the cross entropy can be used as a loss function to train the binary classification model. In this embodiment, using the cross entropy as a loss function to train the binary classification model is only an exemplary explanation. In other embodiments, the loss function can also be other functions, which will not be repeated here.
[0098] In this embodiment, after obtaining the medical text in the training set and the corresponding multiple candidate disease entities, the medical text in the training set and the corresponding multiple candidate disease entities are input into the pre-training model in pairs, and then the pre-training model is trained according to the recall results of the training set to obtain a binary classification model. The steps of training the binary classification model according to the training set and the recall results of the training set are refined, providing a model basis for the subsequent acquisition of the preset entity recognition model.
[0099] In one embodiment, if Figure 7 As shown, in step S50, the preset entity recognition model is determined according to the test set and the binary classification model, which specifically includes the following steps:
[0100] S51: Use the binary classification model to predict the test set to obtain the disease entity prediction results.
[0101] After obtaining the binary classification model, the medical texts in the test set that are not labeled with disease entities are predicted using the binary classification model to obtain disease entity prediction results for each medical text in the test set.
[0102] S52: Obtain manual review results of disease entity prediction results.
[0103] After obtaining the disease entity prediction results of each medical text in the test set, the obtained disease entity prediction results are manually reviewed to determine whether the disease entity prediction results of each medical text in the test set are correct, and each disease entity prediction result is labeled according to the determination result to obtain the manual review result.
[0104] S53: Update the training set based on the disease entity prediction results and the corresponding manual review results.
[0105] After obtaining the manual review results of the disease entity prediction results, the correctly predicted medical texts are selected, and the correctly predicted medical texts are annotated with disease entities according to the corresponding disease entity prediction results to obtain the correctly predicted medical texts and the corresponding disease entity annotating results. Finally, the correctly predicted medical texts and the corresponding disease entity annotating results are added to the training set to increase the data of the training set, thereby improving the recognition accuracy of the training model.
[0106] S54: Repeatedly train the binary classification recognition model according to the updated training set to obtain a preset entity recognition model.
[0107] After updating the training set according to the disease entity prediction results and the corresponding manual review results, recall processing is performed on the updated training set, and then the recall results of the updated training set are obtained. The binary classification recognition model is then trained again based on the updated training set and the recall results of the updated training set to obtain the prediction results on the test set. The above process is then repeated until the recognition accuracy of the binary classification recognition model for the test set reaches the expected level, and the binary classification recognition model with the expected recognition accuracy is used as the preset entity recognition model to ensure the accuracy of the preset entity recognition model in recognizing disease entities.
[0108] In this embodiment, after obtaining the binary classification model, the test set is predicted by using the binary classification model to obtain the disease entity prediction results, and then the manual review results of the disease entity prediction results are obtained. The training set is updated with the disease entity prediction results and the corresponding manual review results. Finally, the binary classification recognition model is repeatedly trained according to the updated training set to obtain the preset entity recognition model. The process of determining the preset entity recognition model based on the test set and the binary classification model is refined. By updating the training set according to the manual review results, the data of the training set is increased, and the accuracy of the preset entity recognition model is further improved.
[0109] It should be understood that the order of execution of the steps in the above embodiment does not necessarily mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present invention.
[0110] In one embodiment, a deep learning model-based entity recognition device is provided, and the deep learning model-based entity recognition device corresponds to the deep learning model-based entity recognition method in the above embodiment. Figure 8 As shown, the entity recognition device based on the deep learning model includes a first acquisition module 801, an input module 802, a second acquisition module 803 and an output module 804. Each functional module is described in detail as follows:
[0111] The first acquisition module 801 is used to acquire the medical text to be recognized;
[0112] An input module 802 is used to input the medical text to be recognized into a preset entity recognition model, wherein the preset entity recognition model is an entity recognition model obtained by training according to a training set and a recall result of the training set, wherein the training set is a medical text training set in which disease entities mentioned in different ways in each medical text are annotated, and the recall result of the training set is a processing result of recalling each medical text according to all disease entities in the medical text;
[0113] The second acquisition module 803 is used to obtain the entity recognition result output by the preset entity recognition model;
[0114] The output module 804 is used to use the entity recognition result as the disease entity mentioned in the medical text to be recognized, and output the disease entity.
[0115] Furthermore, the entity recognition device based on the deep learning model also includes a model training module 805, and the model training module 805 is specifically used for:
[0116] Determining a training set and a test set of the preset entity recognition model based on existing medical texts;
[0117] Using a search server to search for multiple candidate disease entities corresponding to each medical text in the training set, the candidate disease entities being disease entities whose name segmentations appear in the medical text;
[0118] Annotating the corresponding multiple candidate disease entities according to each medical text in the training set to obtain a recall result of the training set;
[0119] A binary classification model is obtained by training according to the training set and the recall result of the training set;
[0120] The preset entity recognition model is determined according to the test set and the binary classification model.
[0121] Furthermore, the model training module 805 is also specifically used for:
[0122] Determining whether the candidate disease entity is a disease entity mentioned in each of the medical texts;
[0123] If the candidate disease entity is a disease entity mentioned in each of the medical texts, the candidate disease entity is marked as a positive example;
[0124] If the candidate disease entity is not a disease entity mentioned in each medical text, the candidate disease entity is marked as a negative example;
[0125] The annotation results corresponding to each of the candidate disease entities are obtained, and the candidate disease entities of each medical text and the annotation results corresponding to each of the candidate disease entities are used as the recall results of the training set.
[0126] Furthermore, the model training module 805 is also specifically used for:
[0127] a. Obtain the names of existing disease entities in medicine;
[0128] b. performing word segmentation processing on the names of the disease entities to obtain multiple word segmentations of the disease entities;
[0129] c. using the search server to determine whether each medical text in the training set contains a word segment of the disease entity;
[0130] d. if the medical text contains any of the participles of the disease entity, the disease entity is used as a candidate disease entity of the medical text;
[0131] e. Repeat steps cd until a preset number of candidate disease entities of the medical text are determined;
[0132] f. Repeat steps ce until candidate disease entities of all medical texts in the training set are obtained.
[0133] Furthermore, the model training module 805 is also specifically used for:
[0134] Inputting the medical texts in the training set and the corresponding multiple candidate disease entities into the pre-training model in pairs;
[0135] The pre-trained model is trained according to the recall result of the training set to obtain the binary classification model.
[0136] Furthermore, the model training module 805 is also specifically used for:
[0137] Using the binary classification model to predict the test set to obtain a disease entity prediction result;
[0138] Obtaining manual review results of the disease entity prediction results;
[0139] Updating the training set with the disease entity prediction results and the corresponding manual review results;
[0140] The binary classification recognition model is repeatedly trained according to the updated training set to obtain the preset entity recognition model.
[0141] For the specific definition of the entity recognition device based on the deep learning model, please refer to the definition of the entity recognition method based on the deep learning model above, which will not be repeated here. Each module in the above-mentioned entity recognition device based on the deep learning model can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
[0142] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Fig. 9 As shown. The computer device includes a processor, a memory, a network interface and a database connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store a preset entity recognition model and the data generated by it. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, an entity recognition method based on a deep learning model is implemented.
[0143] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the following steps when executing the computer program:
[0144] Obtaining medical text to be recognized;
[0145] Input the medical text to be recognized into a preset entity recognition model, wherein the preset entity recognition model is an entity recognition model obtained by training according to a training set and a recall result of the training set, wherein the training set is a medical text training set in which disease entities mentioned in different ways in each medical text are annotated, and the recall result of the training set is a processing result of recalling each medical text according to all disease entities in the medical text;
[0146] Obtaining an entity recognition result output by the preset entity recognition model;
[0147] The entity recognition result is used as the disease entity mentioned in the medical text to be recognized, and the disease entity is output.
[0148] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
[0149] Obtaining medical text to be recognized;
[0150] Input the medical text to be recognized into a preset entity recognition model, wherein the preset entity recognition model is an entity recognition model obtained by training according to a training set and a recall result of the training set, wherein the training set is a medical text training set in which disease entities mentioned in different ways in each medical text are annotated, and the recall result of the training set is a processing result of recalling each medical text according to all disease entities in the medical text;
[0151] Obtaining an entity recognition result output by the preset entity recognition model;
[0152] The entity recognition result is used as the disease entity mentioned in the medical text to be recognized, and the disease entity is output.
[0153] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0154] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example. In actual applications, the above-mentioned functions can be distributed and completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.
[0155] The embodiments described above are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included in the protection scope of the present invention.
Claims
1. An entity recognition method based on a deep learning model, characterized in that: include: Obtaining medical text to be recognized; Input the medical text to be recognized into a preset entity recognition model, wherein the preset entity recognition model is an entity recognition model obtained by training according to a training set and a recall result of the training set, wherein the training set is a medical text training set annotated with disease entities mentioned in different ways in each medical text, and the recall result of the training set is a processing result of recalling each medical text according to all disease entities in each medical text, wherein the medical text training set annotated with disease entities mentioned in different ways includes a medical text training set annotated with disease entities mentioned in a parallel and discontinuous manner, or a medical text training set annotated with disease entities mentioned in a continuous and independent manner; Obtaining an entity recognition result output by the preset entity recognition model; Using the entity recognition result as the disease entity mentioned in the medical text to be recognized, and outputting the disease entity; The preset entity recognition model is obtained in the following way: Determining a training set and a test set of the preset entity recognition model based on existing medical texts; Using a search server to search for multiple candidate disease entities corresponding to each medical text in the training set, the candidate disease entities being disease entities whose name segmentations appear in the medical text; Annotating the corresponding multiple candidate disease entities according to each medical text in the training set to obtain a recall result of the training set; A binary classification model is obtained by training according to the training set and the recall result of the training set; The preset entity recognition model is determined according to the test set and the binary classification model.
2. The entity recognition method based on the deep learning model according to claim 1, characterized in that: The step of labeling the corresponding multiple candidate disease entities according to each medical text in the training set to obtain a recall result of the training set includes: Determining whether the candidate disease entity is a disease entity mentioned in each of the medical texts; If the candidate disease entity is a disease entity mentioned in each of the medical texts, the candidate disease entity is marked as a positive example; If the candidate disease entity is not a disease entity mentioned in each medical text, the candidate disease entity is marked as a negative example; The annotation results corresponding to each of the candidate disease entities are obtained, and the candidate disease entities of each medical text and the annotation results corresponding to each of the candidate disease entities are used as the recall results of the training set.
3. The entity recognition method based on the deep learning model according to claim 1, characterized in that: The step of searching for multiple candidate disease entities corresponding to each medical text in the training set using a search server comprises the following steps: a. Obtain the names of existing disease entities in medicine; b. performing word segmentation processing on the names of the disease entities to obtain multiple word segmentations of the disease entities; c. using the search server to determine whether each medical text in the training set contains a word segment of the disease entity; d. if the medical text contains any of the participles of the disease entity, the disease entity is used as a candidate disease entity of the medical text; e. Repeat steps cd until a preset number of candidate disease entities of the medical text are determined; f. Repeat steps ce until candidate disease entities of all medical texts in the training set are obtained.
4. The entity recognition method based on the deep learning model according to claim 1, characterized in that: The step of training a binary classification model based on the training set and the recall result of the training set includes: Inputting the medical texts in the training set and the corresponding multiple candidate disease entities into the pre-training model in pairs; The pre-trained model is trained according to the recall result of the training set to obtain the binary classification model.
5. The entity recognition method based on a deep learning model according to any one of claims 1 to 4, characterized in that: The step of determining the preset entity recognition model according to the test set and the binary classification model includes: Using the binary classification model to predict the test set to obtain a disease entity prediction result; Obtaining manual review results of the disease entity prediction results; Updating the training set with the disease entity prediction results and the corresponding manual review results; The binary classification recognition model is repeatedly trained according to the updated training set to obtain the preset entity recognition model.
6. An entity recognition device based on a deep learning model, characterized in that: include: A first acquisition module is used to acquire the medical text to be recognized; An input module, used for inputting the medical text to be recognized into a preset entity recognition model, wherein the preset entity recognition model is an entity recognition model obtained by training according to a training set and a recall result of the training set, wherein the training set is a medical text training set annotated with disease entities mentioned in different ways in each medical text, and the recall result of the training set is a processing result of recalling each medical text according to all disease entities in each medical text, wherein the medical text training set annotated with disease entities mentioned in different ways includes a medical text training set annotated with disease entities mentioned in a parallel and discontinuous manner, or a medical text training set annotated with disease entities mentioned in a continuous and independent manner; A second acquisition module is used to obtain the entity recognition result output by the preset entity recognition model; An output module, used to use the entity recognition result as the disease entity mentioned in the medical text to be recognized, and output the disease entity; A model training module, used to determine a training set and a test set of the preset entity recognition model based on existing medical texts; Using a search server to search for multiple candidate disease entities corresponding to each medical text in the training set, the candidate disease entities being disease entities whose name segmentations appear in the medical text; Annotating the corresponding multiple candidate disease entities according to each medical text in the training set to obtain a recall result of the training set; A binary classification model is obtained by training according to the training set and the recall result of the training set; The preset entity recognition model is determined according to the test set and the binary classification model.
7. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the entity recognition method based on the deep learning model as described in any one of claims 1 to 5 are implemented.
8. A readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the entity recognition method based on the deep learning model as described in any one of claims 1 to 5 are implemented.
Citation Information
Patent Citations
Medical insurance case filing auditing method and device executed by computer
CN110866836A
Attribute recall model training method and device, electronic equipment and storage medium
CN111159377A