about 3% of the american population will develop epilepsy by the age of 75.1 the diagnosis of epilepsy significantly affects a patient 's quality of life , and also imposes a considerable medical and economic burden.2 despite the high prevalence of epilepsy , there is an epilepsy  treatment gap , defined as the proportion of people with epilepsy who require treatment but do not receive it.3 racial , ethnic , and socioeconomic disparities in access to healthcare all contribute to this gap.4 recognizing the problem , the american academy of neurology introduced eight quality of care measures.5 it is important for completing these measures that it is determined whether or not there is a degree of uniformity in the clinical vocabulary used by different hospitals  if there is no such uniformity , then we can not use typical natural language processing ( nlp ) methods to compare quality measures , as superficial linguistic differences will spuriously suggest quality differences .
an additional benefit of this research is the development of an nlp algorithm that can be used to compare clinical notes between different hospitals without the need for a huge amount of training data ; such algorithms will become increasingly important in large - scale analyses of healthcare delivery and outcomes . to our knowledge
, no prior statistical analysis has directly quantified similarities and/or differences in the vocabulary of clinical notes across institutions .
however , there has been considerable effort in understanding inter- and intrahospital similarities and differences in clinical notes , as well as the medical terminology used in them .
for instance , in an effort of evaluate interhospital differences uzuner et al,6 was able to train a machine learning technique using discharge summaries from one hospital to classify assertions in discharge summaries and radiology reports from others .
fan et al7 evaluated the ability of an nlp algorithm to tag parts of speech in one medical institution after it was trained using notes from a second institution .
they found that a machine learning model was able to tag parts of speech in clinical notes from kaiser permanente southern california with 89% accuracy when trained on clinical notes from the university of pittsburgh medical center.8 matykiewicz et al9 presented direct intrahospital comparisons of clinical notes which utilized a support vector machine ( svm ) and the k - l divergence to determine whether or not there were differences in the n - gram frequencies in clinical notes from patients with intractable and non - intractable epilepsy .
the latter analysis is directly related to this work : one could replace notes from patients with intractable and non - intractable epilepsy with epilepsy progress notes from different institutions and thereby directly measure the similarities in their vocabulary .
however , such an approach would not address whether or not the linguistic differences among different hospitals were important ( one would expect large - scale interhospital differences from the electronic health record template formatting of the notes ) .
we tackle the problem of quantifying the similarities and differences in epilepsy clinical notes by developing an svm that uses surface linguistic features , and then testing whether or not the interhospital differences in vocabulary are sufficient to prevent the svm from correctly classifying an epilepsy progress note as one describing a patient with generalized ( ge ) , partial ( pe ) , or unclassified epilepsy ( ue ) . pe and ge cover 88% of epilepsy patients.10 given the ambiguous nature of ue assigned by a clinician , but also considering its relatively high prevalence , we first classify the notes using pe and ge , only , and then perform a separate analysis including pe , ge , and ue .
we further investigate whether the classification can be improved by training the svm using progress notes from multiple hospitals .
our approach rests on the assumption that if an svm is trained on epilepsy progress notes from one hospital and is then able to successfully classify notes from another hospital , then the hospitals share a common epilepsy vocabulary . supporting evidence for this assumption would suggest a nationwide commonality in epilepsy vocabulary which can be exploited for epilepsy information extraction ( eg , annotation and classification of epilepsy progress notes across different hospitals ) for quality measures .
the svm classifies the notes based on the frequencies of ( strings of ) words ( n - grams ) in the notes .
the common vocabulary is therefore strictly defined by those n - grams that are associated with the classifications .
however , the classifications are broad enough that reasonable inferences could be made regarding the general epilepsy vocabularies of the hospitals .
the svm is trained to classify each progress note as belonging to a patient with one of three broadly defined categories of epilepsy : pe , ge , and ue . due to the lack of consensus in their annotation ,
the epilepsy progress notes are defined by the icd-9-cm codes assigned to them by their authors with ge defined by 345.00 , 345.01 , 345.10 , 345.11 , and 345.2 ; pe defined by 345.40 , 345.41 , 345.50 , 345.51 , 345.70 , and 345.71 ; and ue defined by 345.80 , 345.81 , 345.90 , and 345.91 .
note that the codes themselves never occur in the notes , and since the clinicians are not required to use any controlled vocabulary , the text strings associated with the codes most likely never occur in the notes either .
table  1 summarizes the icd-9-cm codes and lists the numbers of progress notes available for classification for each hospital .
as there are sizable variations in the number of notes between the three epilepsy types , using them all would result in sample - size effects that could be confused with interhospital differences in vocabulary .
we therefore fix the training and data sample sizes to 90 documents per hospital per epilepsy classification in the training set , and to 45 documents per hospital per epilepsy classification in the testing data set .
the training set is used for two purposes : for cross - validation of the parameter space and for building the optimal classifier . the test set ( ie , 
remaining hospital(s) ) is withheld until the optimal classifier is built on the full training data .
the icd-9-cm codes associated with each type of epilepsy diagnosis , and the corresponding number of clinical notes from each hospital cchmc , cincinnati children 's hospital medical center ; chco , children 's hospital colorado ; chop , children 's hospital of philadelphia . to validate the gold standard in the face of known problems with practitioner - assigned icd-9-cm codes , a random sample of 24 notes from each category was assembled .
each note was annotated by two physicians , with each physician only coding the notes from the hospital(s ) other than their own .
this process resulted in a krippendorff 's  of 0.691 ( with chance agreement of 1/4 ) , suggesting that the gold standard is of good quality . when we combined the post hoc coding with the coding done by the authors of the notes ,
the documents are represented by their unigrams , bigrams , and trigrams , which serve as features for the svm .
we found that the inclusion of n - grams with n larger than 3 decreases classification accuracy ( the f1 score described below ) during training , probably due to over - fitting .
an alternative approach would be to use semantic features , rather than surface linguistic features , by running a term extraction engine such as metamap , ctakes , or conceptmapper , and then classifying based on the extracted semantic concepts .
furthermore , abstraction of semantic concepts has the effect of making the three hospitals more homogeneous , so the surface linguistic features provide a more stringent evaluation of the hypothesis .
we used the electronic health records from the neurology departments of three different hospitals : the cincinnati children 's hospital medical center ( cchmc ) , children 's hospital colorado ( chco ) , and children 's hospital of philadelphia ( chop ) .
the progress notes were required to have been created for an office visit , be over 100 characters in length , and have one of the icd-9-cm codes listed in table 1 .
further , each note had to be signed by an attending clinician , resident , fellow , or nurse practitioner .
lastly , each patient was required to have at least one visit per year between 2009 and 2012 ( for a minimum of four visits ) .
overall , 551 , 614 , and 433 progress notes from chop , cchmc , and chco , respectively , satisfied all of the selection criteria .
the notes were then de - identified using a combination of automatic output from the mitre identification scrubber tool ( mist)11 and manual review .
after de - identification , the n - gram frequencies were extracted from each note , and all characters in the note were changed to lower case .
age , patient name , location , hospital name , any initials , patient identification numbers , phone numbers , urls , and miscellaneous protected information such as account numbers and room numbers were replaced with 
non - ascii and non - alphanumeric characters were then removed , and all numbers were changed to 
numb. all n - grams that occurred less than nine times within the whole data set were removed .
they are particularly useful in cases such as that presented in this work , where the training sample is small but feature rich.12 further , in matykiewicz et al,9 statistical and machine learning methods were compared based on their ability to classify epilepsy progress notes as describing patients with either intractable or non - intractable epilepsy .
the svm proved to be the best classifier , given differences were indeed present between the two classes of notes ( an svm can not quantify similarity ) .
both the progress notes and classification scheme described in this work are similar to those in matykiewicz et al.9 the svms are trained using 90 documents for each of the three epilepsy types , with as many as 23  017 n - grams , and optimized using an f1 score defined by1where tn is the number of true positives , fp is the number of false positives , and fn is the number of false negatives .
the schemes are selected using cross - validation methods , among other parameters . ultimately , the svm is optimized over the cost regularization parameter ( the c parameter ) , the number of top - ranked n - grams to use for the svm input ( n ) , and the ranking method and n - gram weighting schemes using the 20-fold cross - validated f1 score .
the cost parameter is optimized over 18 values ranging from 2 to 2 , incremented by factors of 2 .
parameter n is optimized over 2 to 2 n - grams , incremented by factors of 2 .
the n - grams are ranked based on either information gain , information gain ratio , or the pearson correlation coefficient .
overall , the svm is optimized over 13 values of the c parameter , 16 values of n , 2 feature weightings , 3 feature rankings , and 20 folds .
this translates to an optimization over 1248 points in the parameter space and 24  960 runs of the svm . as discussed previously
we therefore classify ge and pe for three hospitals using training samples from either one or two of the other hospitals .
we also perform a second analysis assuming three possible types of epilepsy  pe , ge , and ue . because svms are built for binary classification , three svms are trained to classify pe versus not - pe , ge versus not - ge , and ue versus not - ue , with the results being subsequently combined to effectively provide a tertiary classification .
we used the electronic health records from the neurology departments of three different hospitals : the cincinnati children 's hospital medical center ( cchmc ) , children 's hospital colorado ( chco ) , and children 's hospital of philadelphia ( chop ) .
the progress notes were required to have been created for an office visit , be over 100 characters in length , and have one of the icd-9-cm codes listed in table 1 .
further , each note had to be signed by an attending clinician , resident , fellow , or nurse practitioner .
lastly , each patient was required to have at least one visit per year between 2009 and 2012 ( for a minimum of four visits ) .
overall , 551 , 614 , and 433 progress notes from chop , cchmc , and chco , respectively , satisfied all of the selection criteria .
the notes were then de - identified using a combination of automatic output from the mitre identification scrubber tool ( mist)11 and manual review .
after de - identification , the n - gram frequencies were extracted from each note , and all characters in the note were changed to lower case .
age , patient name , location , hospital name , any initials , patient identification numbers , phone numbers , urls , and miscellaneous protected information such as account numbers and room numbers were replaced with 
non - ascii and non - alphanumeric characters were then removed , and all numbers were changed to 
numb. all n - grams that occurred less than nine times within the whole data set were removed .
they are particularly useful in cases such as that presented in this work , where the training sample is small but feature rich.12 further , in matykiewicz et al,9 statistical and machine learning methods were compared based on their ability to classify epilepsy progress notes as describing patients with either intractable or non - intractable epilepsy .
the svm proved to be the best classifier , given differences were indeed present between the two classes of notes ( an svm can not quantify similarity ) .
both the progress notes and classification scheme described in this work are similar to those in matykiewicz et al.9 the svms are trained using 90 documents for each of the three epilepsy types , with as many as 23  017 n - grams , and optimized using an f1 score defined by1where tn is the number of true positives , fp is the number of false positives , and fn is the number of false negatives .
ultimately , the svm is optimized over the cost regularization parameter ( the c parameter ) , the number of top - ranked n - grams to use for the svm input ( n ) , and the ranking method and n - gram weighting schemes using the 20-fold cross - validated f1 score .
the cost parameter is optimized over 18 values ranging from 2 to 2 , incremented by factors of 2 .
parameter n is optimized over 2 to 2 n - grams , incremented by factors of 2 .
the n - grams are ranked based on either information gain , information gain ratio , or the pearson correlation coefficient .
overall , the svm is optimized over 13 values of the c parameter , 16 values of n , 2 feature weightings , 3 feature rankings , and 20 folds .
this translates to an optimization over 1248 points in the parameter space and 24  960 runs of the svm . as discussed previously
we therefore classify ge and pe for three hospitals using training samples from either one or two of the other hospitals .
we also perform a second analysis assuming three possible types of epilepsy  pe , ge , and ue . because svms are built for binary classification , three svms are trained to classify pe versus not - pe , ge versus not - ge , and ue versus not - ue , with the results being subsequently combined to effectively provide a tertiary classification .
table  2 summarizes the performance of our svm trained assuming patients are either pe or ge . it shows 20-fold cross - validated f1 's and corresponding sds for both ge and pe progress notes .
the corresponding average f1 's and their sds from progress notes sampled from the hospitals not in the training set ( ie ,  remaining hospitals ) are also listed along with the p value significance , which assume a random baseline classification of f1=50% .
the p values show the svm is capable of classifying pe and ge above baseline , although the p value in the case where the training sample is cchmc and the f1 is evaluated on chop and chco is significantly smaller than in the case when the svm is trained and evaluated with other training and testing data sets .
note that the f1 's are all above approximately 75% when the svm is trained on two hospitals .
the other effect of adding a second hospital is the decreased gap between training f1 and testing f1 .
all three effects suggest that two hospitals are enough to make the third one more similar .
results from the classification of partial epilepsy and generalized epilepsy in epilepsy progress notes the first column lists the hospital(s ) used to optimize the support vector machine .
the second and third columns list the 20-fold cross - validated average f1 and corresponding sds of the training samples , respectively .
the fourth and fifth columns list the average f1 and corresponding sds for the remaining hospital(s ) .
the last column shows the p value significance of the result compared to the largest class baseline f1=0.5 .
systematic improvement when two hospitals are used is highlighted in bold , and the sample size is the same when one and two hospitals are used .
cchmc , cincinnati children 's hospital medical center ; chco , children 's hospital colorado ; chop , children 's hospital of philadelphia .
the results from our second study , where we include patients with ue , are shown in table 3 .
the f1 scores are all above the baseline value of 33% , although somewhat marginally .
as before , there is a 10.4% improvement in f1 when a second hospital is added to the training set and the f1 gap between the training and testing sets decreases from 0.289 to 0.216 , which is an improvement of about 7.3% .
results from the classification of pe , ge , and ue in epilepsy progress notes the first column lists the hospital(s ) used to optimize the support vector machine .
the second and third columns list the 20-fold cross - validated average f1 and corresponding sds of the training samples , respectively .
the fourth and fifth columns list the average f1 and corresponding sds for the remaining hospital(s ) .
the last column shows the p value significance of the result compared to the largest class baseline f1  0.333 .
systematic improvement when two hospitals are used is highlighted in bold , and the sample size is the same when one and two hospitals are used .
cchmc , cincinnati children 's hospital medical center ; chco , children 's hospital colorado ; chop , children 's hospital of philadelphia ; ge , generalized epilepsy ; pe , partial epilepsy ; ue , unclassified epilepsy .
although the changes in the second study are marginal , they do not contradict our previous conclusions .
most likely the notes from ue patients obscure the classification of ge and pe , as words associated with both would also appear in the ue notes .
we have developed an svm classifier with surface linguistic features that supports the rejection of our null hypothesis ( which is that such an algorithm can not be trained using epilepsy - specific notes from one hospital and then successfully used to classify epilepsy patients from another hospital ) with statistical significance .
we have therefore established a certain uniformity among epilepsy progress notes from three different institutions : the cchmc , chco , and chop .
the document / n - gram matrix was built using unigrams , bigrams , and trigrams , and employed for training svm text classifiers .
we also showed that for a given ( fixed ) number of progress notes , the classification of patient notes from a third hospital is improved by using notes from two hospitals in the svm training set .
that is , given the choice of increasing the sample size by increasing the number of notes from a single hospital , or broadening the note pool by including notes from another hospital , our results suggest the latter is the better choice for classification .
the case where the training sample is cchmc progress notes and the model is evaluated on chop and chco progress notes gives a significance of 5% , whereas those cases where two hospitals are included in the training set all yield an improvement over baseline that is statistically significant at a p value of < 0.01 .
we are conscious of certain assumptions and possible biases that are inherent in this analysis ; however , we believe they do not invalidate our conclusions . for example , while our selection criteria for the progress notes introduce biases in the number of ge and pe progress notes , they are not relevant as we train and classify the svm on a fixed number of each .
another factor to consider is that the ge and pe classifications are defined by the icd-9-cm codes , which are used primarily to encode billing information .
although strictly speaking they can not be used as proxies for clinical diagnoses , they were assigned by the author of the note ( a healthcare provider ) .
it is worthwhile noting that while technically our method does not directly address whether clinical vocabulary is the same across all three institutions considered , given our results one can reasonably infer that a degree of similarity exists .
natural language , including clinical language , is complex and ambiguous at the level of vocabulary and at the levels of morphology , syntax , semantics , and document structure .
even so , we can not conclude that the notes are heterogeneous across the three hospitals based on lexical features only .
in fact , we know that the different epic templates used in the different hospitals introduce differences in the document structure and semantic concepts mentioned in the records
. however , our findings are consistent with the idea that even in the face of these additional levels of complexity , surface linguistic features alone do not introduce spurious indicators of differences in quality measures across the three hospitals .
our work has established that there is a certain degree of uniformity of epilepsy vocabulary across different hospitals , and has developed an nlp - based machine learning technique to classify and extract information from epilepsy progress notes .
this suggests that a limited number of annotated epilepsy progress notes from each hospital might be enough for developing automated extraction of epilepsy quality measures from clinical narratives .
 objectivethe constant progress in computational linguistic methods provides amazing opportunities for discovering information in clinical text and enables the clinical scientist to explore novel approaches to care . however , these new approaches need evaluation . 
 we describe an automated system to compare descriptions of epilepsy patients at three different organizations : cincinnati children s hospital , the children s hospital colorado , and the children s hospital of philadelphia . to our knowledge , there have been no similar previous studies.materials and methodsin this work , a support vector machine ( svm)-based natural language processing ( nlp ) algorithm is trained to classify epilepsy progress notes as belonging to a patient with a specific type of epilepsy from a particular hospital . 
 the same svm is then used to classify notes from another hospital . 
 our null hypothesis is that an nlp algorithm can not be trained using epilepsy - specific notes from one hospital and subsequently used to classify notes from another hospital better than a random baseline classifier . 
 the hypothesis is tested using epilepsy progress notes from the three hospitals.resultswe are able to reject the null hypothesis at the 95% level . 
 it is also found that classification was improved by including notes from a second hospital in the svm training sample.discussion and conclusionwith a reasonably uniform epilepsy vocabulary and an nlp - based algorithm able to use this uniformity to classify epilepsy progress notes across different hospitals , we can pursue automated comparisons of patient conditions , treatments , and diagnoses across different healthcare settings . 
Background and significance
Objective
Methods and materials
N-gram extraction
Progress note classification
Results
Discussion
Conclusions