A medical text classification method based on base learner and meta learner
By constructing a heterogeneous model of base learners and meta-learners, and combining multiple models for soft voting optimization, the problem of insufficient accuracy of traditional medical text classification models in handling professional terms and complex structures is solved, and more efficient medical text classification results are achieved.
Patent Information
- Application Number
- CN202411026297.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-30
- Publication Date
- 2024-09-27
- Estimated Expiration
- 2044-07-30
AI Technical Summary
Traditional medical text classification models struggle to effectively capture the subtle semantics of technical terms and complex structures when processing medical data, resulting in insufficient classification accuracy and robustness.
A medical text classification method based on base learners and meta-learners is adopted. By constructing heterogeneous models such as BERT-BiLSM-DPCNN, ERNIE-BiLSM-DPCNN and eHealth-BiLSM-DPCNN, and combining them with SVM, Logistic, Randmforst, MLP and XGBoost models, the prediction results are optimized by using a soft voting mechanism, and semantic information at different levels is extracted and comprehensive information is captured.
It significantly improves the accuracy and robustness of medical text classification, and can more effectively handle technical terms and complex structures in medical texts.
Smart Images

Figure CN118551053B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of text classification, and more specifically, to a medical text classification method based on a base learner and a meta learner. Background Art
[0002] Medical text classification is one of the important tasks of NLP in the medical field. Early text classification mainly relied on rule-based methods, which heavily relied on domain experts to design relevant rules, resulting in limited flexibility and generalization.
[0003] However, with the continuous progress of machine learning, including the emergence of decision trees (DT) and support vector machines (SVM), text classification has become more feasible. For example, Garla et al. proposed a LaplacianSVMs for cancer text classification. However, these methods often ignore the order information of words, resulting in the inability to fully capture the semantic details in the text. With the development of deep learning, RNN and its variants LSTM and BiLSTM have shown excellent performance in text classification. These models can more effectively handle long-term dependencies and local features in text. Kimetal first proposed the use of CNN for text classification. Through multiple convolution and pooling layers, the key features of the text are extracted to give it good parallel processing capabilities and translation invariance. On this basis, Johnson et al. proposed the DPCNN model, which increases the depth of the convolutional neural network (CNN). The computation time of each layer decreases exponentially in a "pyramid" shape, and the basic information is retained through residual connections, thereby improving the accuracy. Cai et al.'s idea of combining BiLSTM and CNN also improved the performance of medical text classification.
[0004] In recent years, pre-trained models such as BERT and ERNIE based on the Transformer architecture have significantly improved the paradigm of natural language processing. These models have greatly improved the accuracy of text classification through deep context understanding and fine-grained semantic capture. Driven by the continuous development of professional application needs, for example, in professional fields such as medicine, due to the large amount of professional terms and complex structures in the text, standard pre-trained models may not be able to fully capture its subtle semantics. In the biomedical field, researchers have developed a variety of pre-trained models for medical text based on Transformer, among which BioBERT developed by Lee et al. and eHealth launched by Baidu have performed significantly. These models are specially optimized for the complex language environment and unique terminology in the medical field to improve the processing and understanding of professional medical literature. In addition, researchers have also explored methods to combine pre-trained models with other neural networks. These hybrid models have shown good results in various classification tasks.
[0005] In the above context, in the healthcare field, the rapid growth of medical data urgently requires more accurate and effective text classification technology. However, traditional models are often challenged by the professional terminology and complex structure in medical texts. In the healthcare field, the rapid growth of medical data urgently requires more accurate and effective text classification technology. However, traditional models are often challenged by the professional terminology and complex structure in medical texts. Summary of the invention
[0006] In order to overcome the above-mentioned defects of the prior art, an embodiment of the present invention provides a medical text classification method based on a base learner and a meta learner to solve the problems raised in the above-mentioned background technology.
[0007] To achieve the above object, the present invention provides the following technical solutions:
[0008] A medical text classification method based on a base learner and a meta learner comprises the following steps:
[0009] Step S1: construct a data set, which includes several medical texts and corresponding labels;
[0010] Step S2: construct a medical text classification model, which includes a base learner and a meta learner. The base learner is composed of a BERT-BiLSM-DPCNN heterogeneous model, an ERNIE-BiLSM-DPCNN heterogeneous model, and an eHealth-BiLSM-DPCNN heterogeneous model in parallel; import the medical text in step S1 into the base learner, and each group of heterogeneous models of the base learner extracts semantic information at different levels from the medical text and outputs the prediction results of the base learner;
[0011] The prediction results of the base learners are combined to form meta-features, expressed as:
[0012] ;
[0013] in, represents the meta-feature, Represents medical text, represents the prediction results of the ith group of heterogeneous models of the base learner on the medical text, Indicates the label corresponding to the medical text, represents the base learner;
[0014] Step S3: The meta-learner is composed of an SVM model, a logistic model, a RandMForst model, an MLP model, and an XGBoost model in parallel. The meta-features of step S2 are imported into the meta-learner. Each group of models of the meta-learner predicts the meta-features respectively to obtain the prediction results of the meta-learner.
[0015] At the same time, the meta-learner is trained according to the label of step S1 and the prediction result of the meta-learner, and the meta-learner is trained by constructing a loss function to optimize the parameters of the meta-learner, wherein the parameters include the weight parameters of the svm heterogeneous model, the logistic heterogeneous model, the randmforst heterogeneous model, the mlp heterogeneous model and the xgboost heterogeneous model and the parameters of the heterogeneous models of each meta-learner;
[0016] Step S4: Calculate the probability estimate of the prediction result of the meta-learner in step S3 as class k through soft voting. The calculation of soft voting is as follows:
[0017] ;
[0018] in, represents the probability matrix of category k corresponding to the prediction result of the meta-learner, represents the total number of heterogeneous models of the meta-learner, Indicates A heterogeneous model of meta-learners, represents the prediction result of the heterogeneous model of the meta-learner in step S3;
[0019] Obtained through soft voting Perform the maximum value index to obtain the final prediction result, which is expressed as follows:
[0020] ;
[0021] in, represents the final prediction result, Represents the maximum value index function.
[0022] Furthermore, in step S2, the medical text of the training set in the data set in step S1 is imported into the base learner, and each group of heterogeneous models of the base learner outputs the prediction result of the base learner, specifically:
[0023] Step S21: pre-processing the input medical text;
[0024] Step S22: vectorizing the medical text preprocessed in step S21 by using the eHealth model, the BERT model, and the ERNIE model to obtain a feature vector, where the feature vector contains character-level and sentence-level information of the medical text;
[0025] Step S23: Send the feature vector of step S22 to the BiLSTM model to process forward and backward information. The process is expressed as follows:
[0026] f t = σ ( W f ⋅ [ h t − 1 , x t ] + b f ) ;
[0027] i t = σ ( W i ⋅ [ h t - 1 , x t ] + b i ) ;
[0028] C ˜ t = tanh( W c ⋅ [ h t − 1 , x t ] + b c ) ;
[0029] ;
[0030] o t = σ ( W o [ h t − 1 , x t ] + b o ) ;
[0031] ;
[0032] ;
[0033] in, represents the sigmoid activation function, represents the Hadamard product, represents vector connection, Represent the weight matrices of the forget gate, input gate, output gate, and candidate input gate, respectively. Respectively represent the bias of the forget gate, input gate, output gate and candidate input gate, represents the hidden state at time t, represents the network input at time t, They represent input gate, forget gate, output gate and unit gate respectively. represents the cell state at time t, represents forward information, Represents backward information, Represents aggregate information, represents the hyperbolic tangent function;
[0034] Step S24: The output vectors of the BiLSTM model are connected and calculated, and then input into the DPCNN model. Local and global features are extracted by equal-length convolution to obtain the extracted feature vector. The extracted features are processed by K-MaxPooling by selecting the C highest eigenvalues, where C represents the size of the convolution kernel, to form the vector that best represents the text features. , then the vector Pass to classifier to obtain the prediction results of the heterogeneous model of the base learner , the calculation process is expressed as follows:
[0035] ;
[0036] ;
[0037] ;
[0038] in, Both represent the output vector of the BiLSTM model. represents the nonlinear activation function, represents the convolution kernel, represents the bias term, represents the concatenated feature vector, Denotes the extracted feature vector.
[0039] Furthermore, the base learner in step S2 is trained, specifically: the training set data in the data set is used to train each heterogeneous model of the base learner, and the training process is represented by minimizing the loss function of the base learner, which is expressed as:
[0040] ;
[0041] in, represents the trained base learner, represents the base learner, represents the base learner loss function, represents the minimum index function, Represents the training set.
[0042] Furthermore, the meta-learner in step S3 is trained by the loss function to optimize the parameters:
[0043] The training process of the meta-learner is performed by minimizing the loss function, which is expressed as:
[0044] ;
[0045] in, represents the trained meta-learner, represents the meta-learner before training, represents the meta-learner loss function, represents the meta-feature, Represents the minimum index function.
[0046] Technical effects and advantages of the present invention:
[0047] The medical text classification method provided by the present invention sets up three heterogeneous models based on the BiLSTM-DPCNN architecture, thereby extracting semantic information at different levels of medical texts and effectively enhancing the comprehensive information capture capability of the model. Furthermore, the present invention trains several meta-learners by combining meta-features generated by multiple base learners, and uses a refined voting mechanism to optimize the final prediction effect, thereby significantly improving the overall accuracy and robustness of medical text classification. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] Figure 1The present invention is a flowchart of the steps of the medical text classification method based on the base learner and the meta learner. DETAILED DESCRIPTION
[0049] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0050] refer to Figure 1 , a medical text classification method based on a base learner and a meta learner, comprising the following steps:
[0051] Step S1: construct a data set, which includes several medical texts and corresponding labels;
[0052] Step S2: construct a medical text classification model, which includes a base learner and a meta learner. The base learner is composed of a BERT-BiLSM-DPCNN heterogeneous model, an ERNIE-BiLSM-DPCNN heterogeneous model, and an eHealth-BiLSM-DPCNN heterogeneous model in parallel; import the medical text in step S1 into the base learner, and each group of heterogeneous models of the base learner extracts semantic information at different levels from the medical text and outputs the prediction results of the base learner;
[0053] The prediction results of the base learners are combined to form meta-features, expressed as:
[0054] ;
[0055] in, represents the meta-feature, Represents medical text, represents the prediction results of the ith group of heterogeneous models of the base learner on the medical text, Indicates the label corresponding to the medical text, represents the base learner;
[0056] Step S3: The meta-learner is composed of an SVM model, a logistic model, a RandMForst model, an MLP model, and an XGBoost model in parallel. The meta-features of step S2 are imported into the meta-learner. Each group of models of the meta-learner predicts the meta-features respectively to obtain the prediction results of the meta-learner.
[0057] At the same time, the meta-learner is trained according to the label of step S1 and the prediction result of the meta-learner, and the meta-learner is trained by constructing a loss function to optimize the parameters of the meta-learner, wherein the parameters include the weight parameters of the svm heterogeneous model, the logistic heterogeneous model, the randmforst heterogeneous model, the mlp heterogeneous model and the xgboost heterogeneous model and the parameters of the heterogeneous models of each meta-learner;
[0058] Step S4: Calculate the probability estimate of the prediction result of the meta-learner in step S3 as class k through soft voting. The calculation of soft voting is as follows:
[0059] ;
[0060] in, represents the probability matrix of category k corresponding to the prediction result of the meta-learner, represents the total number of heterogeneous models of the meta-learner, Indicates A heterogeneous model of meta-learners, represents the prediction result of the heterogeneous model of the meta-learner in step S3;
[0061] Obtained through soft voting Perform the maximum value index to obtain the final prediction result, which is expressed as follows:
[0062] ;
[0063] in, represents the final prediction result, Represents the maximum value index function.
[0064] Furthermore, in step S2, the medical text of the training set in the data set in step S1 is imported into the base learner, and each group of heterogeneous models of the base learner outputs the prediction result of the base learner, specifically:
[0065] Step S21: pre-processing the input medical text;
[0066] Step S22: vectorizing the medical text preprocessed in step S21 by using the eHealth model, the BERT model, and the ERNIE model to obtain a feature vector, where the feature vector contains character-level and sentence-level information of the medical text;
[0067] Step S23: Send the feature vector of step S22 to the BiLSTM model to process forward and backward information. The process is expressed as follows:
[0068] f t = σ ( W f ⋅ [ h t − 1 , x t ] + b f ) ;
[0069] i t = σ ( W i ⋅ [ h t - 1 , x t ] + b i ) ;
[0070] C ˜ t = tanh( W c ⋅ [ h t − 1 , x t ] + b c ) ;
[0071] ;
[0072] o t = σ ( W o [ h t − 1 , x t ] + b o ) ;
[0073] ;
[0074] ;
[0075] in, represents the sigmoid activation function, represents the Hadamard product, represents vector connection, Represent the weight matrices of the forget gate, input gate, output gate, and candidate input gate, respectively. Respectively represent the bias of the forget gate, input gate, output gate and candidate input gate, represents the hidden state at time t, represents the network input at time t, They represent input gate, forget gate, output gate and unit gate respectively. represents the cell state at time t, represents forward information, Represents backward information, Represents aggregate information, represents the hyperbolic tangent function;
[0076] Step S24: The output vectors of the BiLSTM model are connected and calculated, and then input into the DPCNN model. Local and global features are extracted by equal-length convolution to obtain the extracted feature vector. The extracted features are processed by K-MaxPooling by selecting the C highest eigenvalues, where C represents the size of the convolution kernel, to form the vector that best represents the text features. , then the vector Pass to classifier to obtain the prediction results of the heterogeneous model of the base learner , the calculation process is expressed as follows:
[0077] ;
[0078] ;
[0079] ;
[0080] in, Both represent the output vector of the BiLSTM model. represents the nonlinear activation function, represents the convolution kernel, represents the bias term, represents the concatenated feature vector, Denotes the extracted feature vector.
[0081] Furthermore, the base learner in step S2 is trained, specifically: the training set data in the data set is used to train each heterogeneous model of the base learner, and the training process is represented by minimizing the loss function of the base learner, which is expressed as:
[0082] ;
[0083] in, represents the trained base learner, represents the base learner, represents the base learner loss function, represents the minimum index function, Represents the training set.
[0084] Furthermore, the meta-learner in step S3 is trained by the loss function to optimize the parameters:
[0085] The training process of the meta-learner is performed by minimizing the loss function, which is expressed as:
[0086] ;
[0087] in, represents the trained meta-learner, represents the meta-learner before training, represents the meta-learner loss function, represents the meta-feature, Represents the minimum index function.
[0088] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A medical text classification method based on base learner and meta learner, It is characterized in that The following steps are involved: Step S1: construct a data set, which includes several medical texts and corresponding labels; Step S2: construct a medical text classification model, which includes a base learner and a meta learner. The base learner is composed of a BERT-BiLSM-DPCNN heterogeneous model, an ERNIE-BiLSM-DPCNN heterogeneous model, and an eHealth-BiLSM-DPCNN heterogeneous model in parallel; import the medical text in step S1 into the base learner, and each group of heterogeneous models of the base learner extracts semantic information at different levels from the medical text and outputs the prediction results of the base learner; The prediction results of the base learners are combined to form meta-features, expressed as: ; in, represents the meta-feature, Represents medical text, represents the prediction results of the ith group of heterogeneous models of the base learner on the medical text, Indicates the label corresponding to the medical text, represents the base learner; Step S3: The meta-learner is composed of an SVM model, a logistic model, a RandMForst model, an MLP model, and an XGBoost model in parallel. The meta-features of step S2 are imported into the meta-learner. Each group of models of the meta-learner predicts the meta-features respectively to obtain the prediction results of the meta-learner. At the same time, the meta-learner is trained according to the label of step S1 and the prediction result of the meta-learner, and the meta-learner is trained by constructing a loss function to optimize the parameters of the meta-learner, wherein the parameters include the weight parameters of the svm heterogeneous model, the logistic heterogeneous model, the randmforst heterogeneous model, the mlp heterogeneous model and the xgboost heterogeneous model and the parameters of the heterogeneous models of each meta-learner; Step S4: Calculate the probability estimate of the prediction result of the meta-learner in step S3 as class k through soft voting. The calculation of soft voting is as follows: ; in, represents the probability matrix of category k corresponding to the prediction result of the meta-learner, represents the total number of heterogeneous models of the meta-learner, Indicates A heterogeneous model of meta-learners, represents the prediction result of the heterogeneous model of the meta-learner in step S3; Obtained through soft voting Perform the maximum value index to obtain the final prediction result, which is expressed as follows: ; in, represents the final prediction result, Represents the maximum value index function.
2. The medical text classification method based on a base learner and a meta learner as claimed in claim 1, It is characterized in that In step S2, the medical text of the training set in the data set in step S1 is imported into the base learner, and each group of heterogeneous models of the base learner outputs the prediction result of the base learner, specifically: Step S21: pre-processing the input medical text; Step S22: vectorizing the medical text preprocessed in step S21 by using the eHealth model, the BERT model, and the ERNIE model to obtain a feature vector, where the feature vector contains character-level and sentence-level information of the medical text; Step S23: Send the feature vector of step S22 to the BiLSTM model to process forward and backward information. The process is expressed as follows: ; ; ; ; ; ; ; in, represents the sigmoid activation function, represents the Hadamard product, represents vector connection, Represent the weight matrices of the forget gate, input gate, output gate, and candidate input gate, respectively. Respectively represent the bias of the forget gate, input gate, output gate and candidate input gate, represents the hidden state at time t, represents the network input at time t, They represent input gate, forget gate, output gate and unit gate respectively. represents the cell state at time t, represents forward information, Represents backward information, Represents aggregate information, represents the hyperbolic tangent function; Step S24: The output vectors of the BiLSTM model are connected and calculated, and then input into the DPCNN model. Local and global features are extracted by equal-length convolution to obtain the extracted feature vector. The extracted features are processed by K-MaxPooling by selecting the C highest eigenvalues, where C represents the size of the convolution kernel, to form the vector that best represents the text features. , then the vector Pass to classifier to obtain the prediction results of the heterogeneous model of the base learner , the calculation process is expressed as follows: ; ; ; in, Both represent the output vector of the BiLSTM model. represents the nonlinear activation function, represents the convolution kernel, represents the bias term, represents the concatenated feature vector, Denotes the extracted feature vector.
3. The medical text classification method based on a base learner and a meta learner as claimed in claim 1, It is characterized in that The base learner in step S2 is trained as follows: The training set data in the data set are used to train each heterogeneous model of the base learner respectively. The training process is expressed as minimizing the loss function of the base learner, which is expressed as: ; in, represents the trained base learner, represents the base learner, represents the base learner loss function, represents the minimum index function, Represents the training set.
4. The medical text classification method based on a base learner and a meta learner as claimed in claim 1, It is characterized in that The meta-learner in step S3 is trained to optimize the parameters through the loss function: The training process of the meta-learner is performed by minimizing the loss function, which is expressed as: ; in, represents the trained meta-learner, represents the meta-learner before training, represents the meta-learner loss function, represents the meta-feature, Represents the minimum index function.
