Multi-label medical text classification method and system based on medical entity relationship and medical record relationship
By constructing a multi-label medical text classification model that combines medical entity relationships and medical record relationships, the problem of existing models being unable to capture key medical entities is solved, achieving higher quality text representation and prediction results.
Patent Information
- Application Number
- CN202310800922.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-29
- Publication Date
- 2025-11-28
- Estimated Expiration
- 2043-06-29
AI Technical Summary
Existing multi-label medical text classification methods neglect medical entity relationships and medical record relationships, making it difficult for the model to capture key medical entities in the medical record and resulting in poor prediction performance.
A multi-label medical text classification model is constructed, including a semantic encoding layer, a reversible transformation layer, and an output layer. It combines a classification loss function and a contrastive learning loss function based on medical entity relationships. By introducing medical entity relationship information from UMLS, a medical record database is constructed, and similar medical record information is retrieved during the prediction stage to provide reference.
This improved the model's ability to capture medical entities and the quality of text representation, thus enhancing the prediction performance of multi-label medical text classification.
Smart Images

Figure CN116775884B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the technical field of natural language processing, artificial intelligence and medical information, and mainly relates to a multi-label medical text classification method and system based on medical entity relationship and medical record relationship. BACKGROUND
[0002] In recent years, with the rapid development of the social medical system, the medical field text also increases explosively year by year, and the useful information contained in the massive text needs to be fully mined and utilized. In order to better manage medical texts, mainly medical records, and facilitate researchers to search and analyze and utilize, the current medical field database often labels each document with its related labels. The most widely used is the International Classification of Diseases (ICD) developed by the World Health Organization. At present, the eleventh revision of the International Classification of Diseases (ICD-11 Chinese version) is used in China. Using the unified coding method of diseases is conducive to the storage, retrieval and analysis of medical data. Labeling medical records with related medical codes and conducting unified management is a solid foundation for forming intelligent medical applications.
[0003] At present, the medical field database still relies on professional medical labeling personnel to label each medical record with its related medical codes. The medical labeling personnel needs to browse the full text of the medical record and other available documents, and then manually selects multiple suitable medical codes from the existing tens of thousands of medical codes and assigns them to the medical record. The manual labeling process not only consumes time and effort but also is prone to errors. In addition, it requires medical labeling personnel to have good medical knowledge and be familiar with labeling specifications and rules, and needs to regularly train professional medical labeling personnel to keep up with the continuous update of the disease classification method (i.e. the medical code system).
[0004] With the rapid development of artificial intelligence technology in recent years, semantic recognition technology is becoming mature, which provides a prerequisite for the application of automated multi-label medical text classification method in medical information systems. With the help of deep learning technology, the multi-label medical text classification method can automatically predict all medical codes (usually more than one) related to the medical record according to the medical record. However, the current multi-label medical text classification method often ignores the important role of medical entity relationship and medical record relationship, making it difficult to capture key medical entities in the medical record and provide reliable reference for the model prediction, and thus resulting in poor model prediction effect. SUMMARY
[0005] The present application is aimed at the problem that it is difficult to capture key medical entities and their professional meanings in lengthy medical records in the prior art, resulting in poor text representation quality. In order to improve the prediction effect of the multi-label medical text classification method, a multi-label medical text classification method and system based on medical entity relationship and medical record relationship are provided. First, the medical records during the patient's hospitalization and the medical codes labeled by the medical labeling personnel are collected, and are divided into a training set, a validation set and a test set to construct a multi-label medical text classification data set. Then, a multi-label medical text classification model is constructed, which includes a semantic encoding layer for encoding medical records, a reversible conversion layer for contrastive learning and an output layer for predicting all related medical codes of the medical records, and the encoding layer, the reversible conversion layer and the output layer are sequentially constructed. Then, the multi-label medical text classification model is trained, and a classification loss function and a contrastive learning loss function based on medical entity relationship are constructed as the loss function for model training. The trained model is used to construct a medical record database. Finally, the multi-label medical text classification model is used to predict the medical codes related to the medical records by searching similar medical record information in the medical record database and combining the classification results of the model. The multi-label medical text classification method based on medical entity relationship and medical record relationship proposed in the present application has achieved significant results on real multi-label medical text classification data sets and has great application prospects in the field of medical data management.
[0006] To achieve the above-mentioned purpose, the technical scheme adopted by the present application is as follows: a multi-label medical text classification method based on medical entity relationship and medical record relationship, comprising the following steps:
[0007] S1, constructing a multi-label medical text classification data set: collecting medical records during the patient's hospitalization and medical codes labeled by medical labeling personnel, and dividing them into a training set, a validation set and a test set to construct a multi-label medical text classification data set;
[0008] S2, constructing a multi-label medical text classification model: the model includes a semantic encoding layer for encoding medical records, a reversible conversion layer for contrastive learning and an output layer for predicting all related medical codes of the medical records, and the encoding layer, the reversible conversion layer and the output layer are sequentially constructed;
[0009] S3, training the multi-label medical text classification model: constructing a classification loss function and a contrastive learning loss function based on medical entity relationship as the loss function for model training, and using the trained model to construct a medical record database;
[0010] S4, using the multi-label medical text classification model to predict: using the model trained in step S3 to search similar medical record information in the medical record database and combine the classification results of the model to predict the medical codes related to the medical records.
[0011] As an improvement of the present application, the step S1 further comprises preprocessing of the medical record text, word segmentation, lowercasing and lemmatization of the medical record text, and replacing numbers in the medical record with "NUM".
[0012] As an improvement of the present application, in the semantic encoding layer of the step S2, a text encoder is constructed to encode the input medical record text and formalize it as Input. The multi-label medical text classification model is based on DiscNet, the input of which is composed of two parts, word embedding (Word Embedding) and section type embedding (Section Type Embedding). The input vector of each word in the sentence can be obtained by adding the two vectors, and the type information of the section to which the word belongs is fused. Through the text encoder and in combination with the label-aware attention mechanism, the label-specific document representation at the word level can be obtained.
[0013] The word embedding of the first and last words in the sentence is spliced as the sentence embedding (Sentence Embedding) input into the text encoder, and in combination with the label-aware attention mechanism, the label-specific document representation at the sentence level can be obtained.
[0014] Finally, the two representations are spliced and the final label-specific document representation is obtained through the max-pooling operation That is,
[0015] V = DiscNet (Input).
[0016] As another improvement of the present application, in the reversible conversion layer of the step S2, for the label-specific document representation V generated by the text encoder, a unique document representation vector v = MaxPool (V) ∈ R d is obtained by using the max-pooling operation, and a reversible conversion layer is further constructed, assuming that is a conversion matrix, and v is mapped to a new document embedding space in the following way: v T = Mv + b M , wherein is a bias term.
[0017] As another improvement of the present application, in the output layer of the step S2, a multi-layer perceptron (MLP) is constructed as the output layer, the label-specific document representation V is input into the output layer, and the final prediction result of the model, i.e. the prediction probability vector
[0018]
[0019] As still another improvement of the present application, the step S3 specifically comprises the following steps:
[0020] S31: Construct a classification loss function, which adopts a cross-entropy loss function, and the formula is as follows:
[0021]
[0022] where x represents the input medical record text, i.e., a word sequence; y and respectively represent the real label vector of the medical record and the label vector predicted by the model; and θ represents all trainable parameters in the model.
[0023] S32: Construct an entity-based contrastive learning loss function, construct positive examples of the current medical record by mapping entities to their synonyms in the UMLS knowledge base (Unified Medical Language System), and construct negative examples by replacing entities with unrelated entities or directly deleting them. During the training process, the positive and negative examples of the medical record i are input into the model, and the document representations of the positive and negative examples are obtained through the text encoder and the reversible conversion layer and
[0024] The InfoNCE loss function of contrastive learning is applied to the medical records in a batch, and the entity-based contrastive learning loss function The formula for calculating the entity-based contrastive learning loss function is as follows:
[0025]
[0026] where the negative example set ψ(·,·) is used to calculate the cosine similarity between two vectors.
[0027] S33: Add the classification loss function of step S31 and the entity-based contrastive learning loss function of step S32 to obtain the total loss function for model training.
[0028] S34: Construct a medical record database. After the model training based on steps S31 and S32 is completed, the trained model is obtained. By inputting all medical records in the training set into the model, a medical record database can be constructed:
[0029]
[0030] where N is the number of medical records in the training set, the text representation v i and the real label y i of the medical record i constitute a key-value pair in the database.
[0031] In order to achieve the above object, the technical scheme adopted by the present application is: a multi-label medical text classification system based on medical entity relationship and medical record relationship, comprising a multi-label medical text classification data set construction unit, a multi-label medical text classification model construction unit, a multi-label medical text classification model training unit and a multi-label medical text classification model prediction unit,
[0032] The multi-label medical text classification data set construction unit is used to collect medical records during the hospitalization of patients and medical codes labeled by medical annotators for the medical records, and divide them into a training set, a validation set and a test set to construct a multi-label medical text classification data set;
[0033] The multi-label medical text classification model construction unit comprises a semantic encoding layer for encoding medical records, a reversible conversion layer for contrast learning and an output layer for predicting all related medical codes of the medical records;
[0034] The multi-label medical text classification model training unit is used to construct a classification loss function and a contrast learning loss function based on medical entity relationship, the classification loss function is used to constrain the classification results of the model by using real labels, and the contrast learning loss function is used to enhance the text representation quality of the medical records by introducing medical entity relationship information in UMLS, the two loss functions are summed together as a loss function for model training, and a medical record database is constructed by using the trained model;
[0035] The multi-label medical text classification model prediction unit is used to predict the medical codes related to the medical records by searching similar medical record information in the medical record database and combining the classification results of the model.
[0036] As an improvement of the present application, the multi-label medical text classification model construction unit further comprises a text encoder construction unit, a reversible conversion layer construction unit and an output layer construction unit,
[0037] The text encoder construction unit generates label-specific document representation, and uses DiscNet to encode the input medical record to obtain the final label-specific document representation V;
[0038] The reversible conversion layer construction unit generates a unique document representation vector v T , which is used for subsequent entity-based contrast learning and storage into the medical record database;
[0039] The output layer construction unit predicts the medical codes related to the medical records according to the label-specific document representation V.
[0040] Compared with the prior art, the present application has the beneficial effects:
[0041] (1) The application can effectively introduce medical entity relationships in UMLS based on entity-based contrast learning to enhance the capture and understanding ability of different medical entities expressing the same medical concept, and effectively improve the quality of medical record text representation.
[0042] (2) The application proposes a method based on medical record relationships, which can provide reliable reference for model prediction by constructing a medical record database and retrieving similar medical record information in the database during the test phase to utilize the relationship information between medical records.
[0043] (3) The application proposes a multi-label medical text classification method based on medical entity relationships and medical record relationships, which can effectively improve the prediction effect of the model. BRIEF DESCRIPTION OF DRAWINGS
[0044] Figure 1 The training phase and test phase of the multi-label medical text classification method based on medical entity relationships and medical record relationships of the application are shown in the schematic diagram;
[0045] Figure 2 The step flow chart of the multi-label medical text classification method based on medical entity relationships and medical record relationships of the application is shown in the schematic diagram;
[0046] Figure 3 The structure schematic diagram of the multi-label medical text classification system based on medical entity relationships and medical record relationships of the application is shown in the schematic diagram;
[0047] Figure 4 The training flow chart of the multi-label medical text classification model of the application is shown in the schematic diagram. DETAILED DESCRIPTION
[0048] The application will be further illustrated in conjunction with the drawings and specific embodiments, and it should be understood that the following specific embodiments are only used to illustrate the application and not to limit the scope of the application.
[0049] Example 1
[0050] The multi-label medical text classification method based on medical entity relationships and medical record relationships, as shown in the schematic diagram, includes the following steps: Figure 2
[0051] S1, constructing a multi-label medical text classification data set: collecting medical records during the patient's hospitalization and medical codes labeled by medical labeling personnel for medical records, and dividing them into training set, validation set and test set to construct a multi-label medical text classification data set;
[0052] The medical records of the patients during hospitalization and the medical codes annotated by the corresponding medical annotators are collected, including the preprocessing of the medical record text. The method specifically comprises the following steps: performing word segmentation, lowercasing and lemmatization on the medical record text, uniformly replacing the numbers in the medical record with "NUM", and segmenting the sentences in the medical record.
[0053] S2, constructing a multi-label medical text classification model: the model comprises a semantic encoding layer for encoding the medical record, a reversible conversion layer for contrastive learning, and an output layer for predicting all relevant medical codes of the medical record, and the encoding layer, the reversible conversion layer and the output layer are sequentially constructed;
[0054] S21 constructing a text encoder
[0055] The text encoder is used to encode the input medical record text and formalize it into Input. DiscNet is the basis of the multi-label medical text classification model proposed in the present application, and the full name of DiscNet is Discourse Net, which is a multi-label medical text classification model. When encoding the medical record text, it utilizes the chapter structure of the medical record, and the hierarchical encoding method can better focus on the details in the lengthy medical record, model the fine-grained information in the text, and thus generate a feature representation with discrimination. At the same time, it designs a method for reconciling label embedding, which can generate higher-quality label-specific document representations.
[0056] DiscNet utilizes three kinds of features to obtain multi-granularity medical document representations: chapter-level features, word-level features and sentence-level features. The input of DiscNet consists of two parts: word embedding (Word Embedding) and section type embedding (Section Type Embedding). Adding these two vectors can obtain the input vector of each word in the sentence, and the type information of the chapter to which the word belongs is fused. Through the text encoder and in combination with the label-aware attention mechanism, a word-level label-specific document representation can be obtained. Similarly, the word embedding of the first and last words in the sentence is concatenated as the sentence embedding (Sentence Embedding) input to the text encoder, and in combination with the label-aware attention mechanism, a sentence-level label-specific document representation can be obtained. Finally, the two representations are concatenated and the final label-specific document representation is obtained through the max-pooling operation
[0057] V = DiscNet (Input)
[0058] Where |C| represents the number of medical codes (i.e. labels), and d represents the dimension of the feature vector.
[0059] S22 constructing a reversible conversion layer
[0060] For a tag-specific document representation V generated by the text encoder, first use max pooling to obtain a unique document representation vector v = MaxPool(V) ∈ R. d This is to facilitate subsequent entity-based comparative learning and storage in the medical record database. Next, a reversible transformation layer is constructed, assuming... As a transformation matrix, v is mapped to the new document embedding space in the following way: v T =Mv+b M ,in It is a bias term.
[0061] S23 Constructs the output layer
[0062] A multilayer perceptron (MLP) is constructed as the output layer. The label-specific document representation V is input to the output layer, and the model's final prediction result, i.e., the prediction probability vector, is output through a sigmoid activation function.
[0063]
[0064] S3, Training a multi-label medical text classification model: Construct a classification loss function and a contrastive learning loss function based on medical entity relationships, which are used together as the loss function for model training. The trained model is then used to construct a medical record database.
[0065] S31 Construct the classification loss function
[0066] The cross-entropy loss function, most commonly used in classification models, is adopted, and the formula is as follows:
[0067]
[0068] Where x represents the input medical record text, i.e., the sequence of words. y and These represent the true label vector and the model-predicted label vector of the medical record, respectively. For example, y j This represents the label value of the j-th class, which can be either 0 or 1. This represents the probability value of the prediction for the j-th class. θ represents all trainable parameters in the model.
[0069] S32 Constructing an entity-based contrastive learning loss function
[0070] The present application proposes to construct positive and negative examples of medical entity relationship knowledge based on UMLS, and introduce professional knowledge in UMLS into text representation through contrastive learning. The full name of UMLS is Unified Medical Language System. As a unified medical language system, it generalizes different expressions under the same concept through CUI (Concept Unique Identifier). Under a CUI, UMLS includes the canonical name of the concept, as well as other expressions of the concept as synonyms, thus containing the synonym relationship knowledge between medical entities.
[0071] Specifically, the SciSpacy tool is used to mine key medical entities in each chapter of each medical record, and then Figure 1 The positive examples of the current medical record (i.e. positive medical records +) are constructed by mapping the entities to their synonyms in the Unified Medical Language System (UMLS) knowledge base. Similarly, negative examples (i.e. negative medical records -) are constructed by replacing the entities with unrelated entities or directly deleting them. Then, during the training process, the positive and negative examples of medical record i are input into the model, and their document representations are obtained through the text encoder and reversible conversion layer And
[0072] The InfoNCE loss function of contrastive learning will be applied to a batch of medical records, and the entity-based contrastive learning loss function The calculation formula is as follows:
[0073]
[0074] Where the negative example set ψ(·,·) is used to calculate the cosine similarity between two vectors.
[0075] S33 adds the two loss functions of step S31 and step S32 as the total loss function of model training.
[0076] S34 constructs a medical record database
[0077] As shown in Figure 4 , Figure 4 is a model training flowchart of a multi-label medical text classification model. After completing the model training process based on steps S31 and S32, the trained model can be obtained. Given a medical record (x i ,y i ) in the training set, x iInput the model, and maximum pooling operation is performed on the label-specific document representation output by the model, so as to obtain the unique document representation v of the medical record i By inputting all medical records in the training set into the model, a medical record database can be constructed Wherein, N is the number of medical records in the training set, the text representation v of the medical record i i And the real label y i Constitute a key-value pair in the database.
[0078] S4, using a multi-label medical text classification model to predict: using the model trained in step S3, similar medical record information in the medical record database is retrieved, and the classification result of the model is combined to predict the medical code related to the medical record.
[0079] As shown in the test stage in Figure 1 , input a medical record x, and the model will output a prediction vector In addition, by performing maximum pooling operation on the label-specific document representation output by the model, the query document representation v of the test medical record can be obtained query , which is used to retrieve the database K and obtain the k nearest neighbors: The kNN-based prediction result can be calculated based on N:
[0080]
[0081]
[0082] Wherein, d(·,·) is a measurement function based on the Euclidean distance, τ' represents the temperature coefficient of kNN, and alpha i represents the weight of the i-th neighbor. The closer the neighbor distance to the test medical record, the greater the weight, and the more worthy of being referenced.
[0083] Finally, the and are combined to calculate the final prediction result:
[0084]
[0085] Wherein, lambda is a proportion parameter for controlling the information source.
[0086] In the experimental process, each deep learning model is realized based on the deep learning framework Pytorch, and the parameters are set as follows: the learning rate set in the training process is 1e-5, the batch size is 12, the optimizer is Adam, and the regularization method uses Dropout to prevent overfitting. The value of k in k-nearest neighbor retrieval is set to 20, and lambda is set to 0.2.
[0087] The model of the present application is compared with some advanced methods on the MIMIC-III dataset, and the specific experimental results are shown in Table 1.
[0088] Table 1: Experimental results on the MIMIC-III dataset.
[0089] Methods Micro F1 Precision@8 CAML 0.539 0.709 LAAT 0.575 0.738 ISD 0.559 0.745 DiscNet 0.588 0.765 Ourmodel 0.596 0.771
[0090] As can be seen from the above table, the method of the present application has a significant improvement compared with other methods. In summary, the method of the present application enhances the capture ability and understanding ability of medical entity relationship based on entity-based contrastive learning to improve the quality of text representation; the method of the present application retrieves similar medical record information in the prediction stage to utilize the medical record relationship, which provides an effective basis for the prediction of the model, and the method of the present application achieves significant results on real multi-label medical text classification data sets, and has great application prospects in the field of medical data management.
[0091] Embodiment 2
[0092] A multi-label medical text classification system based on medical entity relationship and medical record relationship, as shown in Figure 3 includes a multi-label medical text classification data set construction unit, a multi-label medical text classification model construction unit, a multi-label medical text classification model training unit and a multi-label medical text classification model prediction unit,
[0093] The multi-label medical text classification data set construction unit is used to collect medical records during the patient's hospitalization and the medical codes labeled by the medical annotators corresponding to the medical records, and divide them into a training set, a validation set and a test set to construct a multi-label medical text classification data set;
[0094] The multi-label medical text classification model construction unit includes a semantic encoding layer for encoding medical records, a reversible conversion layer for contrastive learning and an output layer for predicting all related medical codes of the medical records; the unit also includes a text encoder construction unit, a reversible conversion layer construction unit and an output layer construction unit,
[0095] The text encoder construction unit aims to generate label-specific document representations, and uses DiscNet to encode the input medical records to obtain the final label-specific document representations V;
[0096] The reversible conversion layer construction unit aims to generate a unique document representation vector v T for subsequent entity-based contrastive learning and storage into the medical record database;
[0097] The output layer construction unit aims to predict the medical codes related to the medical records according to the label-specific document representations V;
[0098] The multi-label medical text classification model training unit is configured to construct a classification loss function and an entity-based contrastive learning loss function, sum the two loss functions to serve as a loss function for model training, and use the trained model to construct a medical record database;
[0099] The classification loss function is configured to constrain the classification result of the model by using the real label.
[0100] The entity-based contrastive learning loss function is configured to enhance the text representation quality of the medical record by introducing medical entity relationship information in UMLS, and the objective function of the model is the sum of the two loss functions, the objective function is minimized through model training, and the model parameters are updated.
[0101] The medical record database is configured to generate unique document representations of all medical records in the training set using the trained model, and store the medical records to construct a database.
[0102] The multi-label medical text classification model prediction unit is configured to use the trained model to search for similar medical record information (to utilize medical record relationships) in the medical record database and combine the classification result of the model to predict medical codes related to the medical record.
[0103] It should be noted that the above content only illustrates the technical idea of the present application, and cannot limit the protection scope of the present application. For those skilled in the art, without departing from the principles of the present application, a number of improvements and refinements can be made, which fall within the scope of protection of the claims of the present application.
Claims
1. A multi-label medical text classification method based on medical entity relationships and medical record relationships, characterized by : comprising the following steps: S1, constructing a multi-label medical text classification data set: collecting medical records during the patient's hospitalization and the medical codes labeled by the corresponding medical annotators, and dividing them into a training set, a validation set and a test set to construct a multi-label medical text classification data set; S2, constructing a multi-label medical text classification model: the model includes a semantic encoding layer for encoding medical records, a reversible conversion layer for contrastive learning, and an output layer for predicting all related medical codes of the medical records, and sequentially constructing the encoding layer, the reversible conversion layer and the output layer; S3, training a multi-label medical text classification model: constructing a classification loss function and a contrastive learning loss function based on medical entity relationship, serving as the loss function for model training together, using the trained model to construct a medical record database; constructing an entity-based contrastive learning loss function, constructing the positive examples of the current medical record by mapping the entity to its synonym in the UMLS knowledge base, and constructing the negative examples by replacing the entity with an unrelated entity or directly deleting it, inputting the positive and negative examples of the medical record into the model during the training process, obtaining their document representations through the text encoder and reversible conversion layer and ; ; The InfoNCE loss function of contrast learning will be applied to the medical records in a batch, based on the entity-based contrast learning loss function The calculation formula is as follows: ; wherein the negative example set ; for computing the cosine similarity between two vectors; S4, predicting using a multi-label medical text classification model: using the model trained in step S3, similar medical record information in the medical record database is retrieved and combined with the classification results of the model to predict the medical codes related to the medical records. 2.The medical entity relationship and medical record relationship based multi-label medical text classification method of claim 1, wherein: The step S1 further comprises preprocessing of the medical record text, word segmentation, lowercasing and lemmatization of the medical record text, and the numbers in the medical record are uniformly replaced with "NUM", and the sentences in the medical record are segmented. 3.The method of claim 2, wherein the medical entity relationship and medical record relationship based multi-label medical text classification method is characterized by: In the semantic encoding layer of step S2, a text encoder is constructed to encode the input medical record text into The multi-label medical text classification model is based on DiscNet, the input of which is composed of word embedding and section type embedding. The input vector of each word in the sentence is obtained by adding the two vectors, and the type information of the section to which the word belongs is fused. Through the text encoder and in combination with the label-aware attention mechanism, the label-specific document representation at the word level can be obtained. The word embeddings of the first and last words in the sentence are concatenated as sentence embeddings to input the text encoder, and the label-aware attention mechanism can obtain label-specific document representations at the sentence level; Finally, the two representations are concatenated and a final label-specific document representation is obtained by a max-pooling operation i.e. 。 4.The method of claim 3, wherein the medical entity relationship and medical record relationship based multi-label medical text classification method is characterized by: the reversible transformation layer of step S2, for the document representation specific to the label generated by the text encoder obtaining a unique document representation vector with a max-pooling operation reconstructing the reversible transformation layer, setting the transformation matrix, mapping to the new document embedding space by where is a bias term. 5.The method of claim 4, wherein the medical entity relationship and medical record relationship based multi-label medical text classification method is characterized by: In the output layer of the step S2, a multi-layer perceptron MLP is constructed as the output layer, and a label-specific document representation is output The input and output layers, and the final prediction result of the model, i.e., the prediction probability vector, is output through a sigmoid activation function : 。 6.The method of claim 1, wherein the medical entity relationship and medical record relationship based multi-label medical text classification method is characterized by: The step S3 specifically comprises the following steps: S31: constructing a classification loss function, which adopts a cross-entropy loss function, as follows: ; wherein represents the input medical record text, i.e., a sequence of words; and represent the true label vector of the medical record and the model-predicted label vector, respectively; denotes all trainable parameters in the model; S32: constructing an entity-based contrastive learning loss function; S33: adding the classification loss function of step S31 and the entity-based contrastive learning loss function of step S32 as the total loss function of model training; S34: constructing a medical record database, after the model training based on steps S31 and S32, a trained model is obtained; by inputting all medical records in the training set into the model, a medical record database can be constructed: ; wherein, is the number of medical records in the training set, medical record a textual representation and a true label form a key-value pair in the database.
7. A multi-label medical text classification system based on medical entity relationships and medical record relationships, characterized by: The multi-label medical text classification data set construction unit is used to collect medical records during the patient's hospitalization and the medical codes labeled by the corresponding medical annotators, and divide them into a training set, a validation set and a test set to construct a multi-label medical text classification data set; The multi-label medical text classification model construction unit includes a semantic encoding layer for encoding medical records, a reversible conversion layer for contrastive learning, and an output layer for predicting all related medical codes of the medical records; The multi-label medical text classification model prediction unit is used to use the trained model to retrieve similar medical record information in the medical record database and combine the classification results of the model to predict the medical codes related to the medical records. The multi-label medical text classification model training unit is configured to construct a classification loss function and a contrastive learning loss function based on medical entity relationships. The classification loss function constrains the classification results of the model by using real labels. The contrastive learning loss function enhances the text representation quality of the medical record by introducing medical entity relationship information in UMLS. The two loss functions are summed together as the loss function for model training. The trained model is used to construct a medical record database. The entity-based contrastive learning loss function is constructed by mapping entities to their synonyms in the UMLS knowledge base to construct positive examples of the current medical record, replacing entities with unrelated entities or directly deleting them to construct negative examples. During the training process, the positive and negative examples of the medical record are input into the model together. The document representations of the positive and negative examples are obtained through a text encoder and a reversible conversion layer. and ; The InfoNCE loss function of contrast learning will be applied to the medical records in a batch, based on the entity-based contrast learning loss function The calculation formula is as follows: ; wherein the negative example set ; for calculating the cosine similarity between two vectors; The multi-label medical text classification model construction unit further comprises a text encoder construction unit, a reversible conversion layer construction unit and an output layer construction unit, 8. The multi-label medical text classification system based on medical entity relationships and medical record relationships of claim 7, wherein: The text encoder building unit generates a label-specific document representation, and encodes the input medical record using DiscNet to obtain a final label-specific document representation ; The reversible conversion layer construction unit generates a unique document representation vector for subsequent entity-based contrastive learning and storage into a medical record database; The output layer construction unit is configured to construct the output layer based on the label-specific document representation Predicting medical codes related to a medical record.
Citation Information
Patent Citations
A multi-label classification method for electronic medical records based on symptom extraction and feature representation
CN109460473A
Hierarchical multi-label text classification method based on mixed attention
CN114896388A