Entity recognition model generation method, device and computer readable storage medium

Through the adversarial training method of generator and discriminator, labeled and unlabeled text medical data are used to optimize entity recognition model training, which solves the problem of requiring a large amount of training sample data in the existing technology, and achieves high-performance entity recognition model training and Accuracy improved.

CN112420205BActive Publication Date: 2024-09-06EWELL TEHCNOLOGY CO LTD
View PDF 10 Cites 0 Cited by

Patent Information

Application Number
CN202011422415.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-12-08
Publication Date
2024-09-06
Estimated Expiration
2040-12-08

AI Technical Summary

Technical Problem

Entity recognition models based on deep learning in the existing technology require a large amount of training sample data to ensure recognition accuracy, resulting in data annotation that is time-consuming and laborious and requires a high amount of data.

Method used

Through the adversarial training method of the generator and the discriminator, labeled and unlabeled text medical data are used to confront each other to optimize the model training process, reduce dependence on a large amount of labeled data, and improve the recognition performance of the model.

Benefits of technology

With the minimum amount of annotations, high-performance entity recognition model training is achieved, improving the accuracy and efficiency of entity recognition and reducing dependence on annotated data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112420205B
    Figure CN112420205B
Patent Text Reader

Abstract

The present application discloses a method, device and computer-readable storage medium for generating an entity recognition model. The entity recognition model includes a generator and a discriminator. The method includes pre-training the generator with labeled text medical data based on a deep learning method, training the discriminator with the text medical data label prediction results of the generator and the labeled text medical data; retraining the generator with labeled text medical data and unlabeled text medical data at the same time, so that the discriminator cannot determine whether the predicted label is correct or wrong, and continuously training the generator and the discriminator until the model training cutoff condition of the generator is met. The present application solves the problem that a large amount of training sample data is required to ensure the accuracy of entity recognition in the prior art, and a high-performance entity recognition model can be obtained without a large amount of training sample data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of artificial intelligence technology, and in particular to a method and device for generating an entity recognition model and a computer-readable storage medium. Background Art

[0002] With the rapid development and widespread application of artificial intelligence technology, natural language processing technology, as a guarantee for effective communication between people and computers, also needs to be developed accordingly. Entity recognition is an aspect of natural language processing, which can identify the entity information contained in a piece of speech. Existing entity recognition models are divided into three categories: one is a rule-based entity recognition model, one is a statistical method-based entity recognition model, and the other is a deep learning-based entity recognition model. Among them, the rule-based entity recognition model generally requires expert experience and knowledge and complex maintenance and upgrade work. Although the entity recognition model based on statistical methods can effectively solve the problems of the rule-based entity recognition model, this method requires tedious feature engineering work before training the model. The entity recognition model based on deep learning does not require feature engineering before training the model. Compared with the other two methods, the entity recognition model built based on deep learning can recognize entities more efficiently and accurately.

[0003] In the prior art, the entity recognition model built based on deep learning is a network architecture Transformer. This method focuses on the calculation of the relationship between texts, while weakening the previous specific network structure, such as the multi-layer bidirectional Transformer architecture model BERT (Bidirectional Encoder Representations from Transformers). However, the network model based on BERT contains huge calculation parameters, and the speed of prediction results often cannot meet the actual needs of entity recognition efficiency. Therefore, the more lightweight model based on Transformer has become a research hotspot in recent years. FLAT (Flat-Lattice Transformer) uses a layer of Transformer to perform mutual calculations between characters and words at the input stage based on the characteristics of Chinese. In the field of Chinese entity recognition, FLAT effectively improves the accuracy and speed compared to BERT. However, in the process of building entity recognition models based on deep learning, related technologies still require a large amount of training sample data to ensure the accuracy of the final entity recognition. Summary of the invention

[0004] The present application provides a method, device and computer-readable storage medium for generating an entity recognition model, which solves the problem in the prior art that a large amount of training sample data is required to ensure the accuracy of entity recognition, and a high-performance entity recognition model can be obtained without a large amount of training sample data.

[0005] To solve the above technical problems, the embodiments of the present invention provide the following technical solutions:

[0006] An embodiment of the present invention provides a method for generating an entity recognition model, comprising:

[0007] Obtaining a training sample set of an entity recognition model, wherein the training sample set includes a plurality of labeled text medical data and a plurality of unlabeled text medical data; the entity recognition model includes a generator and a discriminator;

[0008] The generator is trained in advance using the labeled text medical data based on a deep learning method; the discriminator is trained using the text medical data label prediction results of the generator and the labeled text medical data; the generator is trained simultaneously using the labeled text medical data and the unlabeled text medical data so that the discriminator cannot determine whether the predicted label is correct or incorrect; the generator and the discriminator are continuously trained until the model training cutoff condition of the generator is met.

[0009] Optionally, the continuously training the generator and the discriminator until a model training cutoff condition of the generator is satisfied further includes:

[0010] Inputting the labeled text medical data in the training sample set into the trained discriminator to obtain the labeling accuracy score of each labeled text medical data;

[0011] Selecting candidate text medical data whose annotation accuracy score is lower than a preset accuracy threshold from each annotated text medical data;

[0012] Select the incorrectly labeled text medical data from the candidate text medical data.

[0013] Optionally, selecting the text medical data with incorrect labeling from each candidate text medical data includes:

[0014] Sending each candidate text medical data to a pre-bound user terminal to display it to the user for manual screening;

[0015] According to the screening results fed back by users, text medical data with incorrect labels are determined from each candidate text medical data.

[0016] Optionally, the continuously training the generator and the discriminator until a model training cutoff condition of the generator is satisfied further includes:

[0017] Selecting text medical data to be annotated from the training sample data set according to the output results of the generator and the discriminator;

[0018] The training sample set is updated according to the labeling result of the text medical data to be labeled.

[0019] Optionally, updating the training sample set according to the annotation results of the text medical data to be annotated includes:

[0020] Send each text medical data to be annotated to a pre-bound user terminal to display it to the user for manual annotation;

[0021] According to the manual annotation results fed back by users, each text medical data to be annotated is updated to the annotated text medical data.

[0022] Optionally, the text medical data to be annotated is selected from the training sample data set according to the output result of the entity recognition model:

[0023] According to the output results of the generator and the discriminator in the entity recognition model trained for the nth time, the text medical data to be annotated is selected from the training sample data set based on the priority selection condition, and the priority selection condition is:

[0024]

[0025] Wherein, 1≤n≤m is a positive integer, m is the total number of training times of the entity recognition model, U is the unlabeled text medical data, x is a text medical data, x U is an unlabeled text medical data, T(.) is the text medical data to be labeled, L is the labeled text medical data, V is the implicit variable of the text medical data, v U Corresponding to an unlabeled text medical data x U The implicit variable, V L is the latent variable of all annotated text medical data, sim(v U ,V L ) is the output of the discriminator, α and γ are the set thresholds, P(y * |x U ) is the corresponding unlabeled text medical data x U Label y * probability.

[0026] Another aspect of the present invention provides an entity recognition model generation device, including:

[0027] A sample data set acquisition module is used to acquire a training sample set of an entity recognition model, wherein the training sample set includes a plurality of labeled text medical data and a plurality of unlabeled text medical data; the entity recognition model includes a generator and a discriminator;

[0028] The model training module is used to pre-train a generator using the labeled text medical data based on a deep learning method; train the discriminator using the text medical data label prediction results of the generator and the labeled text medical data; train the generator using the labeled text medical data and the unlabeled text medical data at the same time so that the discriminator cannot determine whether the predicted label is correct or incorrect; and continuously train the generator and the discriminator until the model training cutoff condition of the generator is met.

[0029] Optionally, it also includes an error data detection module, which is used to input the labeled text medical data in the training sample set into the trained discriminator to obtain the labeling accuracy score of each labeled text medical data; select candidate text medical data with a labeling accuracy score lower than a preset accuracy threshold from each labeled text medical data; and select text medical data with incorrect label annotations from each candidate text medical data.

[0030] An embodiment of the present invention further provides an entity recognition model generation device, comprising a processor, wherein the processor is configured to implement the steps of the entity recognition model generation method as described in any of the preceding items when executing a computer program stored in a memory.

[0031] Finally, an embodiment of the present invention further provides a computer-readable storage medium, on which an entity recognition model generation program is stored. When the entity recognition model generation program is executed by a processor, the steps of the entity recognition model generation method as described in any of the preceding items are implemented.

[0032] The advantage of the technical solution provided by the present application is that, during the model training process, the discriminator and the generator are used to conduct adversarial training to continuously optimize themselves, thereby having the ability to distinguish correct labels from incorrect labels or labels with defects, and effectively improving the model recognition performance; in addition to text medical annotated data, the present application also uses unlabeled text medical data to train the model, thereby increasing the training sample data of the trainable model in the training sample data set, and achieving excellent model training results with the least amount of annotation. A high-performance entity recognition model can be obtained without a large amount of annotated training sample data, thereby effectively improving the entity recognition capability and helping to improve the recognition accuracy of the entity recognition model.

[0033] In addition, the embodiment of the present invention also provides a corresponding implementation device and a computer-readable storage medium for the entity recognition model generation method, which further makes the method more practical, and the device and the computer-readable storage medium have corresponding advantages.

[0034] It is to be understood that the foregoing general description and the following detailed description are exemplary only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] In order to more clearly illustrate the technical solutions of the embodiments of the present invention or related technologies, the following briefly introduces the drawings required for use in the embodiments or related technical descriptions. 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.

[0036] Figure 1 A schematic diagram of a flow chart of a method for generating an entity recognition model provided by an embodiment of the present invention;

[0037] Figure 2 A schematic diagram of a flow chart of a method for generating an adversarial network provided by an embodiment of the present invention;

[0038] Figure 3 A schematic diagram of the framework of an entity recognition model provided by an embodiment of the present invention;

[0039] Figure 4 A schematic diagram of a generator provided by an embodiment of the present invention using unlabeled text medical data to improve entity recognition effect;

[0040] Figure 5 A schematic diagram of a framework of an entity recognition model provided by an embodiment of the present invention as active learning;

[0041] Figure 6 A schematic diagram of a process for detecting erroneous labels using an entity recognition model provided by an embodiment of the present invention;

[0042] Figure 7 A structural diagram of a specific implementation of the entity recognition model generation device provided in an embodiment of the present invention;

[0043] Figure 8 A structural diagram of another specific implementation of the entity recognition model generation device provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0044] In order to enable those skilled in the art to better understand the scheme of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and specific implementation methods. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than 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.

[0045] The terms "first", "second", "third", "fourth", etc. in the specification and claims of this application and the above drawings are used to distinguish different objects rather than to describe a specific order. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but may include steps or units that are not listed.

[0046] After introducing the technical solutions of the embodiments of the present invention, various non-limiting implementation methods of the present application are described in detail below.

[0047] See first Figure 1 , Figure 1 A flow chart of a method for generating an entity recognition model provided by an embodiment of the present invention, the embodiment of the present invention may include the following contents:

[0048] S101: Obtain a training sample set for an entity recognition model.

[0049] The entity recognition model of this application includes a generator and a discriminator, and the generator and the discriminator constitute a confrontation network GAN, such as Figure 2The figure shows a schematic diagram of the principle of the adversarial network, in which the generator and the discriminator compete with each other and learn from each other. That is, the purpose of the generator is to make the text medical data it generates difficult for the discriminator to distinguish between true and false, while the goal of the discriminator is to distinguish the text medical data generated by the generator from the real text medical data, and to distinguish the text medical data generated by the generator as fake text medical data. The two constantly compete and optimize themselves until, ideally, the text medical data generated by the generator is "realistic", making it difficult for the discriminator to judge whether it is true or false. The generator and the discriminator can be any network structure such as a convolutional neural network CNN, or a long short-term memory artificial neural network LSTM, which does not affect the implementation of this application. The goal of the generator is to make its predicted labels close to the real labels, so as to have the basic ability of entity recognition, and to give the generator the ability to predict the labels of unlabeled text medical data through the training process. The discriminator inputs the labeled text medical data and the generator's prediction results for the unlabeled text medical data, and continuously trains itself to enable itself to distinguish the labels of the labeled text medical data and the predicted labels. The set of training sample data used by the generator and the discriminator during the training process is a training sample set, which may include multiple labeled text medical data and multiple unlabeled text medical data.

[0050] S102: Pre-train the generator using labeled text medical data based on a deep learning method; train the discriminator using the text medical data label prediction results of the generator and the labeled text medical data; train the generator using labeled text medical data and unlabeled text medical data at the same time so that the discriminator cannot determine whether the predicted label is correct or incorrect; continuously train the generator and the discriminator until the model training cutoff condition of the generator is met.

[0051] This step is used to train the entity recognition model in S101. The specific training process may include:

[0052] A1: Use the labeled text medical data in the training sample set to pre-train the generator based on deep learning to obtain a generator with basic entity recognition functions.

[0053] A2: Input the labeled text medical data in the training sample set and the prediction results of the generator in step A1 for the unlabeled text medical data into the discriminator, and train the discriminator based on deep learning so that the discriminator has the ability to distinguish between the labels of labeled text medical data and labels with defects; or has the ability to distinguish between the labels of labeled text medical data and predicted labels. The labels of labeled text medical data are 100% correct labels, and medical data with defective labels are medical data whose corresponding partial or all labels are wrong. The predicted labels are the labels predicted by the generator for the unlabeled text medical data, so in the predicted labels, local labels may be wrong. This step enables the discriminator to distinguish the differences between labeled labels and labels with defects. In other words, the discriminator is used to identify the labels of labeled text medical data and to predict labels.

[0054] A3: Use the labeled text medical data and unlabeled text medical data in the training sample set to train the generator in A1 at the same time, enhance its own entity recognition ability, and deceive the discriminator trained by A2, making it difficult for the discriminator to distinguish whether its predicted label is correct or wrong. This step adds training for unlabeled text medical data on the basis of A1. For labeled text medical data, the goal of the generator is the same as that of A1, while for unlabeled text medical data, the goal of the generator is to make it difficult for the discriminator trained in A2 to distinguish whether its predicted label is correct or wrong, thereby enhancing its own ability to predict labels.

[0055] A4: A1, A2 and A3 are executed in a loop to continuously optimize the generator and discriminator until the generator has a satisfactory ability to identify entities and the loop stops. Having a satisfactory ability to identify entities is the model training cutoff condition, which can be selected according to actual needs. For example, the model training cutoff condition can be that the loss function value of the generator tends to be stable.

[0056] In addition to using text medical annotated data, this step also uses unlabeled text medical data to train itself and improve the ability of entity recognition. Using the idea of ​​adversarial training, the discriminator and the generator are trained against each other and continuously optimized, so that they have the ability to distinguish correct labels from wrong labels or labels with defects.

[0057] In the technical solution provided by the embodiment of the present invention, during the model training process, the discriminator and the generator are used for mutual adversarial training to continuously optimize themselves, so that they have the ability to distinguish correct labels from incorrect labels or labels with defects, and effectively improve the model recognition performance; in addition to text medical annotated data, the present application also uses unlabeled text medical data to train the model, thereby increasing the training sample data of the trainable model in the training sample data set, and achieving excellent model training effects with the least amount of annotation. A high-performance entity recognition model can be obtained without a large amount of annotated training sample data, thereby effectively improving the entity recognition capability and helping to improve the recognition accuracy of the entity recognition model.

[0058] It should be noted that there is no strict order of execution between the steps in this application. As long as they comply with the logical order, these steps can be executed simultaneously or in a certain preset order. Figure 1 This is just a schematic and does not mean that this is the only execution order.

[0059] It is understandable that erroneous text medical annotation data as training sample data will affect the training effect and prediction results of the entity recognition model, so it is particularly important to detect erroneous text medical annotation data and correct it. The current method for detecting erroneous text medical annotation data is based on rule and statistical methods. For example, Mahato et al. recently used UMLS to detect erroneous text medical annotation data. These methods are all based on statistics and rules, and they all require professional domain knowledge and complex system design. The present application also provides a method for detecting erroneous text medical data. Based on the above embodiment, after S103, it can also include:

[0060] The labeled text medical data in the training sample set are input into the trained discriminator to obtain the labeling accuracy score of each labeled text medical data; candidate text medical data with a labeling accuracy score lower than a preset accuracy threshold are selected from each labeled text medical data; and text medical data with incorrect labeling is selected from each candidate text medical data.

[0061] In this embodiment, a batch of text medical data, including labeled text medical data and unlabeled text medical data, can be randomly selected from the training sample set of S101, and an entity recognition model can be generated according to step S102. The above-mentioned labeled text medical data is input into the discriminator of the trained entity recognition model, and the discriminator outputs the score of each text medical labeled data, and sentences below the score threshold are selected. The discriminator has the ability to distinguish between correct sequence labels and incorrect sequence labels. For each sequence medical data, the discriminator determines the accuracy of its label and outputs the corresponding score. The higher the degree of label error, the lower the score output by the discriminator. Among the selected sentences, the text medical data with incorrect labels is screened out. Among them, the incorrectly labeled text medical data can be executed based on the following method:

[0062] Each candidate text medical data is sent to a pre-bound user terminal to be displayed to the user for manual screening; and the text medical data with incorrect labeling is determined from the candidate text medical data based on the screening results fed back by the user.

[0063] This embodiment uses a deep learning model to automatically detect erroneous text medical annotation data without the need for professional domain knowledge and complex rule design to detect erroneous text medical annotation data, further ensuring the high performance of the entity recognition model.

[0064] It is understandable that when the amount of labeled text medical data used as model training sample data is small, the results of model training will be restricted. The deep learning-based framework requires a large amount of text medical labeled data as training samples, so that the results of its training will be satisfactory. However, the labeling of medical data is often time-consuming and laborious, and professional background knowledge is required to ensure the accuracy of medical data labeling. Based on this, in order to use the least labeled data to obtain the best training model, the present application also provides another embodiment, which may also include the following content after S102:

[0065] According to the output results of the entity recognition model, text medical data to be annotated is selected from the training sample data set, and the training sample set is updated according to the annotation results of the text medical data to be annotated.

[0066] The accuracy of the deep learning model is proportional to the number of its training samples within a certain range. The entity recognition model of the present application is obtained by training based on the deep learning model. When the amount of labeled text medical data in the training sample set is small, the result of the model training will be restricted. In order to ensure that the high-performance entity recognition model is obtained through training, this step uses active learning to select the medical data with the most information from the numerous unlabeled text medical data in the training sample set for priority labeling, so as to optimize the model training effect with the least amount of labeling. For example: There are currently 10,000 labeled text medical data, and the accuracy of the model after training with these medical data is 80%. Now you want to increase 1,000 text medical labeling data to improve the accuracy of the model. You can select 1,000 unlabeled text medical data by two methods. 1. Select 1,000 medical data for manual labeling through this step. 2. Randomly select 1,000 medical data for manual labeling. Finally, it will be found that the accuracy of the model trained with 11,000 medical data labeled by this step is higher than the accuracy of 11,000 medical data labeled by method 2. The entity recognition model in this step can be the entity recognition model obtained by any training in step S102, and of course it can also be the latest entity recognition model obtained by each training, and S103 can be performed once using this model. An optional implementation method of this step may include:

[0067] B1: Randomly select a batch of medical data from the training sample set of S101, including annotated and unannotated medical data to establish the initial version of the entity recognition model.

[0068] B2: Refer to the output of the generator and the output of the discriminator of the entity recognition model of B1 at the same time, select priority text medical annotation data, and then manually annotate these medical data and put them into the training sample set in S101, thereby updating the text medical annotation data. These priority text medical annotation data have the following characteristics: the model is trained by the existing and these newly added text medical annotation data, and the performance improvement effect of the trained model is maximized. The preferred text medical data is comprehensively considered based on the output of both the generator and the discriminator, rather than based on the output of only one side. The medical data selected in this way can improve the model performance better than the medical data selected based on only one side.

[0069] B3: The entity recognition model is trained again according to step S102 based on the updated training sample set.

[0070] B4: Loops B2 and B3 until the loop condition ends.

[0071] This step promotes the development of active learning algorithms based on GAN, especially the development of active learning algorithms based on GAN in the field of sequence recognition. The preferred medical data is selected based on the comprehensive consideration of the outputs of both the generator and the discriminator, rather than the output of only one side. The medical data selected in this way can better improve the effect of the model. Among them, the annotation process of text medical data can be:

[0072] Each text medical data to be annotated is sent to a pre-bound user terminal to be displayed to the user for manual annotation; each text medical data to be annotated is updated to the annotated text medical data according to the manual annotation results fed back by the user. The user terminal can be, for example, an IP address for sending pre-set information, or an ID number of the device terminal, or a file storage path, and the text medical data to be annotated is sent to the user based on this information.

[0073] This embodiment selects medical data with high information content from a large amount of unlabeled text medical data for priority labeling, thereby optimizing the model training effect with the minimum amount of labeling, and obtaining a high-performance entity recognition model without a large amount of training sample data.

[0074] As an optional implementation of this embodiment, the selection method of the text medical data to be annotated can be implemented according to the following content:

[0075] According to the output results of the generator and discriminator in the entity recognition model trained for the nth time, the medical data to be annotated are selected from the training sample data set based on the priority selection conditions. The priority selection conditions are:

[0076]

[0077] Where 1≤n≤m is a positive integer, m is the total number of trainings for the entity recognition model, U is the unlabeled text medical data, x is a piece of text medical data, and x U is an unlabeled text medical data, T(.) is the text medical data to be labeled, L is the labeled text medical data, V is the implicit variable of the text medical data, v U Corresponding to an unlabeled text medical data x U The implicit variable, V L is the latent variable of all annotated text medical data, sim(v U ,V L ) is the output of the discriminator, α and γ are the set thresholds, P(y * |x U ) is the corresponding unlabeled text medical data x U The most likely label y * probability.

[0078] In order to make the technical personnel in the field clearly understand the training process of the entity recognition model of the present application, the present application takes the generator network as FLAT-CRF (conditional random field) and the discriminator network as any optional deep learning network as an example to illustrate the entire model training process, which may include:

[0079] The generator FLAT-CRF uses annotated text medical data for pre-training, so that it has the basic ability of entity recognition. Taking medical text medical annotated data as an example, entities in the medical field generally include: diseases, symptoms, drugs, examinations, signs, and treatments. The labels corresponding to each category are shown in Table 1. Taking the 'BIO' annotation method as an example, B represents the beginning of the entity, I represents the middle or end of the entity, and O represents an insignificant word. Table 2 is an example of a text medical annotation data.

[0080] Table 1 Entity categories and corresponding labels

[0081] Entity Class Label Disease di_name Symptom sy_name Medicine me_name Examination ex_name Cure cu_name Vital signs vi_name

[0082] Table 2. Sequences and corresponding tags

[0083]

[0084]

[0085] FLAT uses a single-layer Transformer to calculate the relationships between words and words, and between words and phrases during the input stage. The Transformer consists of two network structures: a multi-head self-attention network and a fully-connected layer network. The attention mechanism takes a query and a key-value pair table. The query is represented by the key-value pair table. Here, the query, key, and value are all vectors representing words in a sentence. The query is obtained by summing the products of the key-value pairs and their weights. The input of FLAT is the mixed input obtained through attention calculation between words and words, and between words and phrases in a sentence. For example, for the sentence "Chongqing Renhe Hospital", the input of FLAT is ['重', '庆', '人', '和', '医', '院', '重庆', '人和药店', '药店']. The CRF (Conditional Random Fields) network layer is built on top of the FLAT layer, so the input of CRF is the output of the FLAT network layer. The output is the label predicted for the input sequence. The CRF network layer calculates the transition matrix between labels. For example, for the previously used label method 'BIO', when the label of the first word is B, the purpose of CRF is to calculate that the probability that the label of the next word is I is much greater than the probability that it is B or O, which avoids the generation of incorrect labels such as 'BBI', 'BOI', and 'BII'. The purpose of the generator FLAT-CRF is to reduce the difference between the label predicted for the labeled text medical data and its true label, so as to make the accuracy of its predicted label higher and higher. The discriminator takes the labeled text medical data and the prediction result of the generator for the unlabeled text medical data, and continuously trains itself to have the ability to distinguish between the label of the labeled text medical data and the predicted label.

[0086] The labeled text medical data in the training sample set is input into FLAT, and then the corresponding vector representation is output. Then, these vector representations are multiplied by the labels of the text medical annotation data to output a latent variable, which represents the distribution of the labeled text medical data, such as Figure 3As shown. Similarly, since the unlabeled text medical data has no labels, its latent variables are obtained by multiplying the vector output by FLAT with the label predicted by the CRF layer. These two latent variables represent the labeled text medical data and the unlabeled text medical data, respectively. The discriminator inputs these two latent variables and learns the difference between the two latent variables. Here, the difference between the two variables is actually the difference between the label of the labeled text medical data and the predicted label of the unlabeled text medical data, because the distribution of the output vectors of FLAT for the labeled text medical data and the unlabeled text medical data is the same, and there is no difference between them. Since then, the discriminator has the ability to identify correct labels and defective or wrong labels. The generator uses labeled text medical data and unlabeled text medical data to train itself at the same time, enhance its entity recognition ability, and enable itself to deceive the trained discriminator.

[0087] As described in the above steps, for labeled text medical data, the purpose of the generator FLAT-CRF is to reduce the difference between the labels predicted by the CRF layer for medical data and their true labels. Figure 4 As shown in the figure, the purpose of the generator is to deceive the discriminator and make it difficult for the discriminator to distinguish between "true and false medical data". After the discriminator is trained through the above steps, the discriminator already has the ability to distinguish the difference between the correct label and the predicted label. In this step, the purpose of the generator is to correct the "wrong" parts in the predicted label so that these wrong labels become correct labels. Therefore, the predicted label becomes the correct label, and the discriminator is difficult to distinguish in this case. Since the generator has the ability to correct wrong labels through this step of training, its entity recognition ability is further enhanced. This is how the generator uses unlabeled text medical data to train itself and further improve its ability to predict labels. The above steps are repeated to continuously optimize the generator and the discriminator. The loop stops until the generator has a satisfactory ability to recognize entities.

[0088] like Figure 5 As shown, active learning may include the following steps:

[0089] According to the claims of entity recognition, a batch of labeled text medical data and unlabeled text medical data are randomly selected to establish the initial version of the entity recognition model GAN-FLAT-CRF. At the same time, refer to the output of the generator and the output of the discriminator to select the priority text medical annotation data. Then, after manually annotating these medical data, they are put into the text medical annotation data set, thereby updating the text medical annotation data set. While the total amount of medical data remains unchanged, the amount of original labeled text medical data increases and the amount of unlabeled text medical data decreases.

[0090] As mentioned earlier, the output of the generator FLAT-CRF is the predicted label. Before the predicted label is generated, the generator predicts the sequence label based on probability. For a sequence, the output of CRF is all the predicted labels corresponding to this sequence and their corresponding probabilities, and CRF selects the label with the highest probability as the predicted label of the sequence. When we select an unlabeled text medical data for prediction, when the probabilities of all predicted labels output by CRF are very close, it means that the model has a low prediction confidence for this medical data. In general, medical data with very low confidence can be selected for priority labeling, because this type of medical data is unknown to the model and contains more information.

[0091] This embodiment not only considers the output of the generator, but also refers to the output of the discriminator. For an unlabeled text medical data, when the discriminator outputs a low score, it means that its corresponding predicted label is very different from the correct label, which means that the model is difficult to predict. The prior art only refers to the predicted probability of the model, which is applied here to the output probability of CRF. This embodiment selects the data that is most difficult for the model to predict through the output of both the generator and the discriminator. This is equivalent to adding another round of screening process after the output probability screening of CRF. The jointly determined data is the most unknown to the model and contains the most information. Therefore, the performance of the model can be further improved by determining the priority labeled data through the joint output of the two. The specific relationship can be as follows:

[0092]

[0093] U(unlabeled) represents unlabeled text medical data. x represents a piece of text medical data, then x U represents an unlabeled text medical data. T(.) represents the preferred and labeled text medical data. L(labeled): represents the labeled text medical data. V represents the implicit variable of the text medical data, then v U Corresponding to an unlabeled text medical data x U The implicit variable of V L represents the implicit variables of all annotated text medical data, sim(v U ,V L ) is the output of the discriminator, and v is calculated U With V L α, γ represent the set thresholds P(y * |x U ) corresponds to the unlabeled text medical data x U The most likely label y * probability.

[0094] Retrain the entity recognition model based on the updated medical data set: The entity recognition model GAN-FLAT-CRF is based on the updated medical data set to build the entity recognition model again. Repeat the above step 3 until the loop condition ends. The loop condition is set according to your own needs. For example, the loop condition is that all unlabeled text medical data are selected through active learning and manually labeled.

[0095] For detecting errors in medical text annotation data, combined with Figure 6 As shown, it may include:

[0096] Randomly select labeled and unlabeled text medical data to establish the entity recognition model GAN-FLAT-CRF. In the labeled text medical data, a small number of correct labels are manually corrected to incorrect labels to verify the model. In fact, in the real annotation world, it is difficult to ensure that all text medical annotation data is correct. The reasons are various, such as the lack of professional knowledge of the annotators. Therefore, artificially correcting a small number of correct labels to incorrect labels is on the one hand to verify the detection ability of the model, and on the other hand to simulate the real annotation world.

[0097] The above labeled text medical data is input into the trained discriminator, which outputs the score of each text medical labeled data, and sentences below the score threshold are selected. After training, the discriminator has the ability to distinguish between true labels and wrong labels. Therefore, for those incorrectly labeled medical data, the discriminator is likely to output low scores. Therefore, sentences below a certain score threshold are selected. Among the selected sentences, the incorrectly labeled medical data are screened out. Among the selected sentences, there are some correct text medical labeled data, so manual screening is required here to screen out the incorrect text medical labeled data.

[0098] As can be seen from the above, the entity recognition model of the embodiment of the present invention uses the idea of ​​confrontation, and uses text medical annotated data and untext medical annotated data to simultaneously or independently perform the tasks of identifying entities, actively learning, and detecting incorrect text medical annotated data. In other words, after an entity recognition model is trained using unlabeled and text medical annotated data, in addition to the ability to recognize, the model also has the ability to actively learn and detect incorrectly annotated data, effectively improving the overall performance of the model.

[0099] The embodiment of the present invention also provides a corresponding device for the entity recognition model generation method, which further makes the method more practical. Among them, the device can be described from the perspective of functional modules and hardware. The entity recognition model generation device provided by the embodiment of the present invention is introduced below. The entity recognition model generation device described below and the entity recognition model generation method described above can be referred to each other.

[0100] From the perspective of functional modules, see Figure 7 , Figure 7 A structural diagram of an entity recognition model generation device provided in an embodiment of the present invention in a specific implementation manner, the device may include:

[0101] The sample data set acquisition module 701 is used to acquire a training sample set of an entity recognition model, wherein the training sample set includes a plurality of labeled text medical data and a plurality of unlabeled text medical data; the entity recognition model includes a generator and a discriminator.

[0102] The model training module 702 is used to pre-train a generator based on a deep learning method using labeled text medical data; train a discriminator using the text medical data label prediction results of the generator and the labeled text medical data; train the generator using labeled text medical data and unlabeled text medical data at the same time so that the discriminator cannot determine whether the predicted label is correct or incorrect; and continuously train the generator and the discriminator until the model training cutoff condition of the generator is met.

[0103] Optionally, in some implementations of the present embodiment, the above-mentioned device may also include, for example, an error data detection module, which is used to input the labeled text medical data in the training sample set into a trained discriminator to obtain the labeling accuracy score of each labeled text medical data; select candidate text medical data whose labeling accuracy score is lower than a preset accuracy threshold from each labeled text medical data; and select text medical data with incorrect label annotations from each candidate text medical data.

[0104] As an optional implementation of this embodiment, the error data detection module may also include a manual screening submodule, which is used to send each candidate text medical data to a pre-bound user terminal to display it to the user for manual screening; and determine the text medical data with incorrect labels from the candidate text medical data based on the screening results fed back by the user.

[0105] Optionally, in some other implementations of this embodiment, the above-mentioned device may also retain a training sample update module, for example, for selecting text medical data to be annotated from the training sample data set according to the output results of the entity recognition model, and updating the training sample set according to the annotation results of the text medical data to be annotated.

[0106] As an optional implementation of this embodiment, the training sample updating module may be specifically used for:

[0107] According to the output results of the generator and discriminator in the entity recognition model trained for the nth time, the medical data to be annotated are selected from the training sample data set based on the priority selection conditions. The priority selection conditions are:

[0108]

[0109] Where 1≤n≤m is a positive integer, m is the total number of trainings for the entity recognition model, U is the unlabeled text medical data, x is a piece of text medical data, and x U is an unlabeled text medical data, T(.) is the text medical data to be labeled, L is the labeled text medical data, V is the implicit variable of the text medical data, v U Corresponding to an unlabeled text medical data x U The implicit variable, V L is the latent variable of all annotated text medical data, sim(v U ,V L ) is the output of the discriminator, α and γ are the set thresholds, P(y * |x U ) is the corresponding unlabeled text medical data x U The most likely label y * probability.

[0110] As some other optional implementations, the above-mentioned training sample update module may include a manual annotation sub-module, which is used to send each text medical data to be annotated to a pre-bound user terminal to display it to the user for manual annotation; and update each text medical data to be annotated to annotated text medical data based on the manual annotation results fed back by the user.

[0111] The functions of the functional modules of the entity recognition model generation device described in the embodiment of the present invention can be specifically implemented according to the method in the above method embodiment. The specific implementation process can refer to the relevant description of the above method embodiment, which will not be repeated here.

[0112] It can be seen from the above that the embodiments of the present invention solve the drawback of the prior art that a large amount of training sample data is required to ensure the accuracy of the final entity recognition, and a high-performance entity recognition model can be obtained without a large amount of training sample data.

[0113] The entity recognition model generation device mentioned above is described from the perspective of functional modules. Furthermore, the present application also provides an entity recognition model generation device, which is described from the perspective of hardware. Figure 8This is a structural diagram of another entity recognition model generation device provided in an embodiment of the present application. Figure 8 As shown, the device includes a memory 80 for storing a computer program; and a processor 81 for implementing the steps of the entity recognition model generation method mentioned in any of the above embodiments when executing the computer program.

[0114] Among them, the processor 81 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 81 can be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). The processor 81 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 81 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 81 may also include an AI (Artificial Intelligence) processor, which is used to process computing operations related to machine learning.

[0115] The memory 80 may include one or more computer-readable storage media, which may be non-transitory. The memory 80 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In this embodiment, the memory 80 is at least used to store the following computer program 801, wherein, after the computer program is loaded and executed by the processor 81, it can implement the relevant steps of the entity recognition model generation method disclosed in any of the aforementioned embodiments. In addition, the resources stored in the memory 80 may also include an operating system 802 and data 803, etc., and the storage method may be temporary storage or permanent storage. Among them, the operating system 802 may include Windows, Unix, Linux, etc. Data 803 may include, but is not limited to, data corresponding to the entity recognition model generation result, etc.

[0116] In some embodiments, the entity recognition model generation device may also include a display screen 82 , an input and output interface 83 , a communication interface 84 , a power supply 85 , and a communication bus 86 .

[0117] Those skilled in the art will understand that Figure 8 The structure shown in does not constitute a limitation on the entity recognition model generating device, and may include more or fewer components than shown in the figure, for example, it may also include a sensor 87.

[0118] The functions of the functional modules of the entity recognition model generation device described in the embodiment of the present invention can be specifically implemented according to the method in the above method embodiment. The specific implementation process can refer to the relevant description of the above method embodiment, which will not be repeated here.

[0119] It can be seen from the above that the embodiments of the present invention solve the drawback of the prior art that a large amount of training sample data is required to ensure the accuracy of the final entity recognition, and a high-performance entity recognition model can be obtained without a large amount of training sample data.

[0120] It is understandable that if the entity recognition model generation method in the above embodiment is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium to execute all or part of the steps of the various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), electrically erasable programmable ROM, register, hard disk, removable disk, CD-ROM, disk or optical disk and other media that can store program code.

[0121] Based on this, an embodiment of the present invention further provides a computer-readable storage medium storing an entity recognition model generation program. When the entity recognition model generation program is executed by a processor, the steps of the entity recognition model generation method described in any of the above embodiments are performed.

[0122] The functions of the functional modules of the computer-readable storage medium described in the embodiment of the present invention can be specifically implemented according to the method in the above method embodiment. The specific implementation process can refer to the relevant description of the above method embodiment, which will not be repeated here.

[0123] It can be seen from the above that the embodiments of the present invention solve the drawback of the prior art that a large amount of training sample data is required to ensure the accuracy of the final entity recognition, and a high-performance entity recognition model can be obtained without a large amount of training sample data.

[0124] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.

[0125] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0126] The above is a detailed introduction to an entity recognition model generation method, device and computer-readable storage medium provided by the present application. Specific examples are used herein to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. It should be pointed out that for ordinary technicians in this technical field, without departing from the principles of the present invention, several improvements and modifications can be made to the present application, and these improvements and modifications also fall within the scope of protection of the claims of the present application.

Claims

1. A method for generating an entity recognition model, characterized in that: include: Obtaining a training sample set of an entity recognition model, wherein the training sample set includes a plurality of labeled text medical data and a plurality of unlabeled text medical data; The entity recognition model includes a generator and a discriminator; Preliminarily based on a deep learning method, the generator is trained using the labeled text medical data; the discriminator is trained using the text medical data label prediction result of the generator and the labeled text medical data; the generator is trained using the labeled text medical data and the unlabeled text medical data at the same time, so that the discriminator cannot determine whether the predicted label is correct or wrong; Continuously training the generator and the discriminator until a model training cutoff condition of the generator is met; Selecting text medical data to be annotated from the training sample data set according to the output results of the generator and the discriminator; Updating the training sample set according to the labeling result of the text medical data to be labeled; Wherein, the medical data to be annotated text is selected from the training sample data set according to the output results of the generator and the discriminator: According to the output results of the generator and the discriminator in the entity recognition model trained for the nth time, the text medical data to be annotated is selected from the training sample data set based on the priority selection condition, and the priority selection condition is: Wherein, 1≤n≤m is a positive integer, m is the total number of training times of the entity recognition model, U is the unlabeled text medical data, x is a text medical data, x U is an unlabeled text medical data, T(.) is the text medical data to be labeled, L is the labeled text medical data, V is the implicit variable of the text medical data, v U Corresponding to an unlabeled text medical data x U The implicit variable, V L is the latent variable of all annotated text medical data, sim(v U ,V L ) is the output of the discriminator, α and γ are the set thresholds, P(y * |x U ) is the corresponding unlabeled text medical data x U Label y * probability.

2. The entity recognition model generation method according to claim 1, characterized in that: After continuously training the generator and the discriminator until the model training cutoff condition of the generator is met, the method further includes: Inputting the labeled text medical data in the training sample set into the trained discriminator to obtain the labeling accuracy score of each labeled text medical data; Selecting candidate text medical data whose annotation accuracy score is lower than a preset accuracy threshold from each annotated text medical data; Select the incorrectly labeled text medical data from the candidate text medical data.

3. The entity recognition model generation method according to claim 2, characterized in that: The step of selecting the text medical data with incorrect labeling from the candidate text medical data includes: Sending each candidate text medical data to a pre-bound user terminal to display it to the user for manual screening; According to the screening results fed back by users, text medical data with incorrect labels are determined from each candidate text medical data.

4. The entity recognition model generation method according to claim 1, characterized in that: The updating of the training sample set according to the annotation result of the text medical data to be annotated comprises: Send each text medical data to be annotated to a pre-bound user terminal to display it to the user for manual annotation; According to the manual annotation results fed back by users, each text medical data to be annotated is updated to the annotated text medical data.

5. An entity recognition model generation device, characterized in that: include: A sample data set acquisition module is used to acquire a training sample set of an entity recognition model, wherein the training sample set includes a plurality of labeled text medical data and a plurality of unlabeled text medical data; the entity recognition model includes a generator and a discriminator; A model training module is used to pre-train a generator using the labeled text medical data based on a deep learning method; train the discriminator using the text medical data label prediction result of the generator and the labeled text medical data; train the generator using the labeled text medical data and the unlabeled text medical data at the same time so that the discriminator cannot determine whether the predicted label is correct or incorrect; and continuously train the generator and the discriminator until the model training cutoff condition of the generator is met; Wherein, the model training module is further used for: Selecting text medical data to be annotated from the training sample data set according to the output results of the generator and the discriminator; updating the training sample set according to the annotation results of the text medical data to be annotated; Wherein, the medical data to be annotated text is selected from the training sample data set according to the output results of the generator and the discriminator: According to the output results of the generator and the discriminator in the entity recognition model trained for the nth time, the text medical data to be annotated is selected from the training sample data set based on the priority selection condition, and the priority selection condition is: Wherein, 1≤n≤m is a positive integer, m is the total number of training times of the entity recognition model, U is the unlabeled text medical data, x is a text medical data, x U is an unlabeled text medical data, T(.) is the text medical data to be labeled, L is the labeled text medical data, V is the implicit variable of the text medical data, v U Corresponding to an unlabeled text medical data x U The implicit variable, V L is the latent variable of all annotated text medical data, sim(v U ,V L ) is the output of the discriminator, α and γ are the set thresholds, P(y * |x U ) is the corresponding unlabeled text medical data x U Label y * probability.

6. The entity recognition model generation device according to claim 5, characterized in that: It also includes an error data detection module, which is used to input the annotated text medical data in the training sample set into the trained discriminator to obtain the annotation accuracy score of each annotated text medical data; Select candidate text medical data whose annotation accuracy score is lower than a preset accuracy threshold from each annotated text medical data; and select text medical data with incorrect label annotation from each candidate text medical data.

7. An entity recognition model generation device, characterized in that: It includes a processor, which is used to implement the steps of the entity recognition model generation method as described in any one of claims 1 to 4 when executing a computer program stored in a memory.

8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores an entity recognition model generation program, and when the entity recognition model generation program is executed by the processor, the steps of the entity recognition model generation method according to any one of claims 1 to 4 are implemented.

Citation Information

Patent Citations

  • Generative adversarial network technology-based medical text generation method

    CN108491497A

  • Medical image segmentation method and system based on generative adversarial network, and electronic equipment

    CN110503654A

  • Model training method and device

    CN110659657A

  • Electronic medical record text named entity recognition method based on pre-trained language model

    CN110705293A

  • Medical named entity identification method utilizing multi-model fusion strategy

    CN111651991A