Clinical Text Classification with Rule-based Features and Knowledge-guided Convolutional Neural Networks

Clinical text classification is an important problem in medical natural language processing. Existing studies have conventionally focused on rules or knowledge sources-based feature engineering, but only a few have exploited effective feature learning capability of deep learning methods. In this study, we propose a novel approach which combines rule-based features and knowledge-guided deep learning techniques for effective disease classification. Critical Steps of our method include identifying trigger phrases, predicting classes with very few examples using trigger phrases and training a convolutional neural network with word embeddings and Unified Medical Language System (UMLS) entity embeddings. We evaluated our method on the 2008 Integrating Informatics with Biology and the Bedside (i2b2) obesity challenge. The results show that our method outperforms the state of the art methods.


Introduction
Clinical records are an important type of electronic health record (EHR) data and often contain valuable and detailed patient information and clinical experiences of doctors. As a fundamental task of natural language processing, text classification plays an important role in clinical records organization and retrieval, and it can support cohort identification and clinical decision [1,2].
Existing clinical text classification studies often use different forms of rules or knowledge sources for feature engineering [3,4,5,6,7]. But most of the studies could not learn effective features automatically, while deep learning methods have shown powerful feature learning capability recently in the general domain [8].
In this work, we propose a new method which combines rule-based features and knowledge-guided deep learning techniques for disease classification. We first identify trigger phrases using rules, then use these trigger phrases to predict classes with very few examples, and finally train a convolutional neural network on the trigger phrases with word embeddings and Unified Medical Language System (UMLS) [9] Concept Unique Identifiers (CUIs) with entity embeddings. We evaluated our method on the 2008 Integrating Informatics with Biology and the Bedside (i2b2) obesity challenge [10], a multilabel classification task focused on obesity and its 15 most common comorbidities (diseases). The results demonstrate that our method outperforms state of the art methods for the challenge.

Clinical Text Classification
A systematic literature review of clinical coding and classification systems has been conducted by Stanfill et al. [11]. Some challenge tasks in biomedical text mining also focus on clinical text classification, e.g., Informatics for Integrating Biology and the Bedside (i2b2) hosted text classification tasks on determining smoking status [10], and predicting obesity and its co-morbidities [12]. In this work, we focus on the obesity challenge [12]. Among the top ten systems of obesity challenge, most are rule-based systems, and the top four systems are purely rule-based.
Many approaches for clinical text classification rely on biomedical knowledge sources [3]. A common approach is to first map narrative text to concepts from knowledge sources like Unified Medical Language System (UMLS), then train classifiers on document representations that include UMLS Concept Unique Identifiers (CUIs) as features [6]. More knowledge-intensive approaches enrich the feature set with related concepts [4] for apply semantic kernels that project documents that contain related concepts closer together in a feature space [7]. Similarly, Yao et al. [13] proposed to improve distributed document representations with medical concept descriptions for traditional Chinese medicine clinical records classification.
On the other hand, some clinical text classification studies use various types of information instead of knowledge sources. For instance, effective classifiers have been designed based on regular expression discovery [14] and semi-supervised learning [15,16]. Active learning [17] has been applied in clinical domain, which leverages unlabeled corpora to improve the classification of clinical text.
Although these methods used rules, knowledge sources or different types of information in many ways. They seldom use effective feature learning methods, while deep learning methods are recently widely used for text classification and have shown powerful feature learning capabilities.

Deep Learning for Clinical Data Mining
Recently, deep learning methods have been successfully applied to clinical data mining. Two representative deep models are convolutional neural networks (CNN) [18,19] and recurrent neural networks (RNN) [20,21]. They achieve state of the art performances on a number of clinical data mining tasks. Beaulieu-Jones et al. [22] developed a neural network approach to construct phenotypes to classify patient disease status. The model obtained better performance than SVM, random forest, and decision tree models. They also claimed to successfully learn the structure of highdimensional EHR data for phenotype stratification. Gehrmann et al. [23] compared convolutional neural networks to the traditional rule-based entity extraction systems using the cTAKES and logistic regression using n-gram features. They tested ten different phenotyping tasks using discharge summaries. The CNN outperformed other phenotyping algorithms in the prediction of ten phenotypes, and they concluded that NLP-based deep learning methods improved the performance of patient phenotyping compared to other methods. Luo et al. applied both CNN and RNN to classify the semantic relations between medical concepts in discharge summaries from the i2b2-VA challenge dataset [24] and showed that CNN and RNN with only word embedding features can obtain similar performances compared to state-of-theart systems by challenge participants with heavy feature engineering [25,26]. Wu et al. [27] applied CNN using a set of pre-trained embeddings on clinical text for named entity recognization. They found that their models outperformed the baseline of conditional random fields (CRF). Geraci et al. [28] applied deep neural networks to identify youth depression from unstructured text notes. The authors achieved a sensitivity of 93.5% and a specificity of 68%. Jagannatha et al. [29,30] experimented with RNN, long short-term memory (LSTM), gated recurrent units (GRU), bidirectional LSTM, combinations of LSTM with CRF, and CRF to extract clinical concepts from texts. They found that all variants of RNN outperformed the CRF base-line. Lipton et al. [31] evaluated the performance of LSTM in phenotype prediction using multivariate time series clinical measurements. They concluded that their model outperformed logistic regression and multi-layer perceptron (MLP). They also concluded that the combination of LSTM and MLP had the best performance. Che et al. [32] also applied deep learning methods to study time series in ICU data. They introduced a prior-based Laplacian regularization process on the sigmoid layer that is based on medical ontologies and other structured knowledge. In addition, they developed an incremental training procedure to iteratively add neurons to the hidden layer. Then they applied causal inference techniques to analyze and interpret the hidden layer representations. They demonstrated that their proposed methods improved the performance of phenotype identification and that the model trains with faster convergence and better interpretation.
Although deep learning techniques have been well studied in clinical data mining, most of these works do not focus on long clinical text classification (e.g., an entire clinical note) or utilize knowledge sources, while we propose a novel knowledgeguided deep learning method for clinical text classification.

Obesity Challenge
The objective of the i2b2 2008 obesity challenge [12] is to assess text classification methods for determining patient disease status with respect to obesity and 15 of its comorbidities: Diabetes mellitus (DM), Hypercholesterolemia, Hypertriglyceridemia, Hypertension, atherosclerotic cardiovascular disease (CAD), Heart failure (CHF), Peripheral vascular disease (PVD), Venous insufficiency, Osteoarthritis (OA), Obstructive sleep apnea (OSA), Asthma, Gastroesophageal reflux disease (GERD), Gallstones, Depression, and Gout. Our goal is to label each document as either Present (Y), Absent (N), Questionable (Q) or Unmentioned (U) for each disease. Macro F 1 score is the primary metric for evaluating and ranking classification methods.
The challenge consists of two tasks, namely textual task and intuitive task. The textual task is to identify explicit evidences of the diseases, while the intuitive task focused on the prediction of the disease status when the evidence is not explicitly mentioned. Thus, the Unmentioned (U) class label was excluded from the intuitive task. The classes are distributed very unevenly: there are only few N and Q examples in textual task data set and few Q examples in intuitive task data set, as shown in Table 1. There exist classes even without training example. For instance, there is no training example with Q and N label for Depression in textual task, and there is no training example with Q label for Gallstones in intuitive task. The details of the datasets can be found in [12].

Method
Our method consists of three steps: identifying trigger phrases, predicting classes with very few examples using trigger phrases and training a knowledge-guided convolutional neural network for more populated classes [1] . We base our method on Solt's system [5] to identify trigger phrases and predict classes with very few examples. Solt's system is a very strong rule-based system. It ranked the first place in the intuitive task and the second place in the textual task and overall first place in i2b2 Obesity challenge. Solt's system can discover very informative trigger phrases with positive, negative or uncertain contexts. We use a Perl implementation [2] of Solt's system provided by the authors.

Trigger Phrases Identification
We follow Solt's system [5] to identify trigger phrases. We first do the same preprocessing including abbreviation resolution and family history removing. We then use the same disease names, their directly associated terms and negative/uncertain words to identify trigger phrases. The trigger phrases are disease names (e.g., Gallstones) and their alternative names (e.g., Cholelithiasis) with or without negative/uncertain words.

Predicting Classes with Very Few Examples using Trigger Phrases
As mentioned above, the classes in obesity challenge are very unbalanced, and some classes even don't have training examples. Therefore we could not predict these classes using machine learning methods and resort to rules defined in Solt's system [5]. We exclude classes with very few examples in training set of each disease. Specifically, we remove examples with Q or N label for textual task and remove examples with Q label in intuitive task. Then for examples in the test set, we use trigger phrases to predict their labels. Following Solt's system [5], we assume positive trigger phrases (disease names/alternatives without negative/uncertain words) are prior to negative trigger phrases, and negative trigger phrases are prior to uncertain trigger phrases. Therefore, if a clinical record has uncertain trigger phrases and dose not have positive/negative trigger phrases, we label it as Q. Similarly, if a clinical record has negative trigger phrases and dose not have positive trigger phrases, we label it as N.

Knowledge-guided Convolutional Neural Networks
After removing classes with very few examples, there are only two classes in the training set of each disease (Y and U for textual task, Y and N for intuitive task). We [1] We released the implementation at https://github.com/yao8839836/obesity. CNN is a powerful deep learning model for text classification, and it performs better than recurrent neural networks in our preliminary experiment. The test phase of our method is given in Figure 2. If a record in test set is labeled Q or N by Solt's system, we trust Solt's system. Otherwise, we use the CNN to predict the label of the record. For each disease, we use its positive trigger phrases with word2vec [33] word embeddings as the input of CNN. We used the pre-trained 200 dimensional word embeddings learned from MIMIC-III [34] clinical notes. We tried word embeddings with 100, 200, 300, 400, 500 and 600 dimensions, and found using 200 dimensional word embeddings performs the best.
We also use medical knowledge source to enrich the input of CNN model. We use MetaMap [35] to link the full clinical text to CUIs in UMLS [9]. After entity linking, a clinical record is represented as a bag of CUIs. We choose the following types of CUIs which are closely related to diseases as the input entities of CNN: Body Part, Organ, or Organ Component (T023), Finding (T033), Laboratory or Test Result (T034), Disease or Syndrome (T047), Mental or Behavioral Dysfunction (T048), Cell or Molecular Dysfunction (T049), Laboratory Procedure (T059), Diagnostic Procedure (T060), Therapeutic or Preventive Procedure (T061), Pharmacologic Substance (T121), Biomedical or Dental Material (T122), Biologically Active Substance (T123) and Sign or Symptom (T184). We list these CUIs types with type unique identifier (TUI) in Table 2. We found using the subset of CUIs leads to better results than using all CUIs. We use pre-trained CUIs embeddings made by De Vine et al [36] as the input entity representations of CNN. Our CNN architecture is given in Fig. 1. The input layer consists of word embeddings of positive trigger phrases and CUIs embeddings of selected CUIs in each clinical record. w 0 , w 1 , w 2 , . . . , w n are words in positive trigger phrases and e 0 , e 1 , e 2 , . . . , e n are CUIs in a record. A one-dimensional convolution layer is built on the input word embeddings and entity embeddings. We use max pooling to select the most important feature with the highest value in the convolutional feature map. We then concatenate the max pooling results of word embeddings and CUIs embeddings. The concatenated hidden features are fed into a fully connected layer, then a dropout and ReLU activation layer. Finally, a fully connected layer is fed to a softmax output layer, whose output is the probability distribution over labels.
We implement our CNN model using TensorFlow [37], a popular deep learning framework. We set the following parameters for our model: the number of convolution filters: 256, the convolution kernel size: 5, the dimension of hidden layer in the fully connected layer: 128, dropout keep probability: 0.8, learning rate: 0.001, batch size: 64, the number of learning epochs: 30. We also tried other settings of these parameters but do not find much difference. We use softmax cross entropy loss as the loss function and Adam algorithm [38] as the optimizer.  Table 3 and Table 4 show Macro F 1 scores and Micro F 1 scores of our method and Solt's system. We report results of both the Solt's paper [5] and the Perl implementation because we base our method on the Perl implementation and we found there are some differences between the paper's results and Perl implementation's results. This is likely due to further feature engineering that are not reflected when Solt et al. submitted classification output to the challenge. For completeness of the results, we show the performances from both Solt's paper and code. We also report the results of our method when using only word embeddings as CNN input. From the two tables, we can note that the Perl implementation performs slightly better than the paper, the authors might not submit their best results to the obesity challenge. We can also observe that CNN with word embeddings performs better than the Perl implementation in intuitive task, which means using a deep learning model can learn effective features for better classification. The input trigger phrases for CNN are the same as the trigger phrases for Y/U (textual task) or Y/N (intuitive task) labeling in the Perl code. The results in the textual task are not improved when using word embeddings only, because the textual task needs explicit evidences to label the records, and the positive trigger phrases contain enough information, therefore CNN with word embeddings may not be particularly helpful. Nevertheless, after adding CUIs embeddings as additional input, more scores for different diseases are improved, and the overall F 1 scores are higher than Solt's system in both textual task and intuitive task. This is likely due to the fact that the disambiguated CUIs are closely related to diseases and their embeddings contain more semantic information, which is helpful for disease classification. To the best of our knowledge, we have achieved the best results in intuitive task so far.
Note that the results of Solt's paper and Perl implementation remain the same, while our method produces slightly different results in different runs. We run our model ten times and found the overall Macro F 1 scores and Micro F 1 scores are significantly higher (p value < 0.05 based on student t test) than Solt's paper and Table 4: Macro F 1 scores and Micro F 1 scores of Solt's system [5] (code) and our method with word embeddings only. Scores in bold font means they are higher than the corresponding scores of the paper and Perl implementation.  implementation. We checked the cases our method failed to predict correctly. and found the most error cases are caused by using Solt's positive trigger phrases. For many error cases, our method predicted N or U when no positive trigger phrases are identified, but the real labels are Y. For some other cases, our method predicted Y when positive trigger phrases are identified, but the real labels are N or U. For some diseases, our proposed method and Solt's system achieved a very high Micro F 1 but a low Macro F 1 . This is due to the fact that there are only a few Q or N records for these diseases (i.e., imbalanced class ratio), and we could not identify effective negative/uncertain trigger phrases using Solt's rules. The regular expressions in Solt's system can be further enriched so that we can identify trigger phrases more accurately. We note that the knowledge features part does not improve much.
In fact, we think MetaMap will indeed introduce some noisy and unrelated CUIs, as previous studies also showed. To remedy this, following Weng et al. [39], we only kept CUIs from selected semantic types that are considered most relevant to clinical tasks. We found that filtering CUIs based on semantic types did lead to moderate performance improvement over using all CUIs. In another related computational phenotyping study [40], we found that manually curated CUI set resulted in significant performance improvement. We believe that improving entity recognition and integrating word/entity sense disambiguation will improve the performance, and plan to explore such directions in future work.
We also compared our method with two commonly used classifiers: Logistic Regression and linear kernel support Vector Machine (SVM). We use LogisticRegression and LinearSVC class in scikit-learn as our implementations. For fair comparison, we use the same training set as knowledge-guided CNN. We represent a record as a binary vector, each dimension means whether an unique word is in its positive trigger phrases. For test examples, we also use Solt's system to predict Q and N. If a test example is not labeled Q or N by Solt's system, we use Logistic Regression or SVM to predict the label. Table 5 shows the results, we can observe that the results are similar to our method with word embeddings only, which means positive trigger phrases themselves are informative enough, while word embeddings could not help to improve the performances. Nevertheless, we run our model ten times and found the overall Macro F 1 scores and Micro F 1 scores are significantly higher (p value < 0.05 based on student t test) than SVM and Logistic Regression, which verifies the effectiveness of CUIs embeddings again.

Conclusion
In this study, we present a new clinical text classification method which combines rule-based features and knowledge-guided deep learning techniques. Specifically, we use rules to identify trigger phrases which contain diseases names, their alternative names and negative/uncertain words, then use these trigger phrases to predict classes with very few examples, and finally train a knowledge-guided convolutional neural network (CNN) with word embeddings and UMLS CUIs embeddings. The evaluation results on the i2b2 obesity challenge show that our method outperforms the state of the art methods for the challenge. We showed that CNN model is powerful for learning effective hidden features, and CUIs embeddings are helpful for building clinical text representations. This shows integrating domain knowledge into CNN models is promising. We plan to develop more principled methods and evaluate the methods on more clinical records datasets in our future work.