Abstract
Carpal tunnel syndrome (CTS) is the most common entrapment neuropathy and often requires surgery when symptoms persist. However, identifying patients requiring surgery remains challenging. This study aimed to develop a predictive model for surgery in CTS patients by integrating standardized common data model (CDM)-based structured data with unstructured data from electromyography (EMG) reports and radiology reports. We retrospectively analyzed 3602 adults diagnosed with CTS at Seoul Metropolitan Boramae Medical Center, of whom 696 (19.3%) underwent surgery within 365 days. Structured CDM data were combined with unstructured text processed using topic modeling, and EMG severity grades were extracted. Predictive models were developed using LASSO logistic regression, gradient boosting machine (GBM), and random forest. Model performance was assessed using the area under the receiver operating characteristic curve (AUROC) and other metrics, and feature importance was evaluated using SHapley Additive exPlanations (SHAP) values. Models incorporating unstructured text and EMG grades outperformed those using structured data alone (AUROC 0.792 vs. 0.759, P < 0.001), with GBM achieving the best performance. SHAP analysis highlighted EMG grade and key text-derived topics as major predictors. These findings demonstrate that combining structured clinical data with unstructured text analysis can effectively predict surgical outcomes in CTS and support clinical decision-making through an integrated data-driven approach.
Supplementary Information
The online version contains supplementary material available at 10.1038/s41598-026-46000-3.
Keywords: Common data model, Carpal tunnel syndrome, Latent Dirichlet allocation, Topic modeling, Machine learning
Subject terms: Computational biology and bioinformatics, Diseases, Medical research, Neurology, Risk factors
Introduction
Carpal tunnel syndrome (CTS) is one of the most common compressive neuropathies caused by compression of the median nerve as it passes through the carpal tunnel in the wrist, and is reported to have a prevalence of 0.003–0.743% of the population worldwide1–3. CTS occurs most frequently in middle-aged women aged 40–50 years4, and the risk increases in individuals engaged in repetitive wrist movements or those with systemic conditions such as diabetes mellitus, thyroid disorders, and rheumatoid arthritis5. Clinically, patients often experience pain, numbness, and tingling in the hand and fingers, predominantly affecting the thumb, index, middle, and part of the ring finger6. Weakness of grip strength and difficulties in fine motor skills are also frequently observed, leading to functional impairments in daily life7. Because these symptoms are common and often recurrent, many individuals encounter difficulties in daily activities and seek medical care. Over time, symptoms may persist or worsen, prompting consideration of surgical intervention. However, determining surgical candidacy is challenging, as it requires integrating diverse clinical information from multiple sources. Thus, there is a growing need for rapid and objective decision-support tools that can be applied in real-world clinical practice8. Electromyography (EMG) test reports and radiology examination reports provide key clinical information for diagnosing CTS and assessing its severity9. EMG quantitatively evaluates nerve compression by measuring nerve conduction velocity and response, while radiology reports assist in identifying anatomical abnormalities of the carpal tunnel and differentiating other lesions10. These reports often contain essential information about individual clinical presentations and test result interpretations that cannot be fully captured in structured data, making them crucial for diagnostic and therapeutic decision-making in CTS patients. In routine clinical practice, EMG and radiology examination reports are documented as narrative clinical text, often in semi-structured formats that combine standardized sections with free-text interpretations. Several studies have applied machine learning to CTS, including models predicting diagnosis, electrophysiologic severity, or postoperative prognosis11,12. However, these studies almost exclusively rely on structured variables (e.g., demographic, electrophysiologic severity scores, anthropometry), with limited attempts to incorporate unstructured clinical narratives such as EMG or radiology reports for predicting surgical intervention. To address this gap, we integrate topic-modeled representations of EMG and radiology reports with structured OMOP-CDM variables to predict the need for surgical intervention in CTS patients.
Although such text data was unstructured and thus limited in its analysis, recent advances in natural language processing (NLP) technology have expanded the possibilities for systematically analyzing and quantifying large-scale clinical text13. In particular, topic modeling, an unsupervised learning technique, is well suited for capturing the complex characteristics of clinical narratives by extracting latent topics without predefined labels and allowing documents to belong to multiple topics simultaneously14,15. By applying topic modeling techniques such as latent Dirichlet allocation (LDA), clinically meaningful content, such as recurring expressions and diagnostic findings from radiology and EMG reports, can be extracted and transformed into quantitative features suitable for predictive modeling16,17. Several studies have applied NLP algorithms to text-based clinical data, such as nursing records18, to predict outcomes including hospital readmission19, post-discharge mortality20, and intensive care unit readmission21. While some research has explored severity prediction22 and postoperative prognosis in CTS patients23,24, studies focusing specifically on predicting surgical intervention remain relatively scarce. Recent data-driven and deep learning-based approaches have demonstrated the ability to model complex, heterogeneous biomedical data and provide clinically actionable predictions25,26. These studies highlight the growing role of machine learning in biomedical decision support and motivate the application of similar data-driven frameworks to CTS surgical risk prediction.
Given the multifactorial and nonlinear pathways leading to CTS surgery, machine learning models provide a valuable framework for integrating diverse clinical features. In this study, algorithms the least absolute shrinkage and selection operator logistic regression (LASSO LR) was used for its interpretability; the tree-based random forest (RF) model was included to capture nonlinear interactions; and gradient boosting model (GBM) was applied for its robustness to high-dimensional, sparse topic features. These models have been widely validated in clinical prediction tasks and allow for detailed interpretability analyses using SHapley Additive exPlanations (SHAP), which is essential for clinical adoption27.
The main research questions were: (1) whether incorporating unstructured text-derived features with structured clinical variables can enhance predictive performance for identifying CTS patients who require surgery, and (2) which these unstructured text-derived features with structured clinical variables most strongly influence surgical decision-making. To address these questions, this study proposes a machine learning based integrated predictive model that combines structured data with unstructured clinical narratives to enable more accurate and clinically interpretable predictions of surgical intervention in CTS patients.
Materials and methods
Data source and cohort description
This study utilized data from the Observational Medical Outcomes Partnership (OMOP) CDM established at Seoul Metropolitan Government–Seoul National University Boramae Medical Center (SMG-SNU BMC). The OMOP-CDM standardizes various Electronic Health Record (EHR) data into a unified structure and terminology, thereby providing a common analytic framework that facilitates multicenter analyses28,29. The clinical data include demographic information, diagnoses, drugs, and procedures.
This study retrospectively evaluated patients diagnosed with CTS at Seoul Metropolitan Boramae Medical Center between January 1, 2010, and December 31, 2022. The inclusion criteria were as follows: (1) age ≥ 18 years; (2) a confirmed diagnosis of CTS (ICD-10 code: G56.0); and (3) completion of both an EMG examination and at least one imaging study prior to the index date. Patients without an EMG report or an imaging report were excluded. If a patient had multiple visits or multiple CTS-related encounters, all records were consolidated at the patient level. The index date was defined as the most recent date of either the EMG test or imaging examination. (Fig. 1). Imaging modalities covered computed tomography (CT), magnetic resonance imaging (MRI), magnetic resonance angiography (MRA), contrast-enhanced MRI, and musculoskeletal ultrasound, spanning anatomical regions such as the cervical spine, wrist, elbow, soft tissues, and peripheral arteries. The outcome was defined as the presence of CTS-related surgical procedures within 365 days after the index date. Relevant procedures in the OMOP-CDM were identified using standardized SNOMED concepts: 4066890 (Endoscopic release of transverse carpal ligament), 4166080 (Decompression of median nerve). These codes comprehensively represent surgical decompression for CTS and were used to define the outcome cohort.
Fig. 1.
Visualization of the prognostic prediction problem.
Data processing
In this study, both structured and unstructured data were utilized to develop the predictive model. The structured data were extracted from standardized OMOP-CDM tables and included patient demographics (sex, visit month, and age at visit), condition (clinical diagnoses), drug (medication), procedure (specific medical interventions performed), measurement (clinical observation records or lab test results obtained), hospital visit types, and visit frequency. Categorical variables were encoded using one-hot encoding according to the default specifications of the FeatureExtraction R package30. All features, except for demographic information and the clinical index score (Charlson Comorbidity Index), were extracted based on this index date. Diagnoses, medications, procedures, measurements, and clinical notes recorded on or after the index date were excluded from feature construction, and only data documented prior to the index date were used as predictors. In this study, missing values were implicitly imputed as 0, following the default framework approach that assumes unrecorded conditions or drugs indicate absence rather than missingness31.
The unstructured data consisted of free-text extracted from radiology reports and EMG reports (Fig. 2). Radiology reports, written by board-certified radiologists, contained findings and impressions, which were concatenated into a single document per patient for NLP analysis. The EMG reports provide physiological diagnostic information relevant to CTS, and this study focused on the results section of these reports for analysis. In particular, the EMG grade variable extracted from EMG reports was used as a key input representing the neurophysiological severity. This variable was based on the Bland grading scale, which classifies severity into seven levels ranging from 0 (normal) to 6 (extremely severe)32. The Bland grading scale is a standardized assessment tool used to quantify the diagnostic certainty and severity of CTS based on the results of nerve conduction studies (NCS), and detailed definitions for each level are provided in Supplementary Table S1. When EMG grade values were recorded for both sides (left and right), the higher value was selected to more accurately reflect the patient’s overall severity. Depending on the experimental condition, the EMG grade variable was either extracted from the text and used as an independent categorical feature or incorporated into the topic modeling process after normalizing severity-related expressions found in the EMG report. In the former case, to avoid redundancy, severity-related expressions were removed from the input text for topic modeling, and the EMG grade variable was entered as a standalone feature. In the latter case, the EMG grade variable was not used separately; instead, the entire text including the normalized severity expressions was used for topic modeling. This approach ensured that the model captured both latent textual patterns and standardized severity information without redundancy.
Fig. 2.
Examples of text reports used in the study: (Left) example of CT imaging report, (Right) example of electromyography (EMG) examination report.
The unstructured data consisted of mixed Korean and English text. All Korean text was translated into English using an automated translation API–based method. A clinician reviewed a subset of the translated reports to ensure that key clinical terminology and EMG-related descriptors were preserved. Prior to analysis, standard preprocessing steps were applied to the unstructured text, including the removal of punctuation, stop words, personal names, and meaningless repetitive words, to ensure that the model focused on clinically relevant content. The preprocessed radiology reports and EMG reports were then analyzed using LDA, a topic modeling technique. LDA is a generative probabilistic model proposed by Blei et al.33, which assumes that each document is composed of multiple latent topics, with each topic represented as a distribution over words34,35. For each patient, the presence or absence of each extracted topic was encoded as a fixed-length binary vector, which was then concatenated with the structured clinical variables to construct the final feature set used for model training.
Experimental design
In this study, we designed and compared three experimental conditions to predict whether patients with CTS would undergo surgery (Fig. 3). For each experimental condition, the LDA topic model was trained independently using its corresponding preprocessed text corpus. All three models aimed to predict the same outcome surgical treatment but differed in the composition of input variables, as follows:
CDM-based clinical covariate: Only structured clinical variables from the OMOP-CDM were used.
CDM-based clinical covariate + radiology/EMG report text: Incorporating both structured clinical variables and unstructured text data, including preprocessed radiology reports and EMG reports. Topic modeling was performed using LDA on the combined text data. Expressions related to severity were normalized and retained in the text, but the corresponding EMG grade values were not used as separate variables.
CDM-based clinical covariate + radiology/EMG report text + EMG grade: LDA-based topic modeling was applied to the full radiology and EMG reports; however, severity-related expressions (Bland grading scale) were removed from the text prior to topic modeling. Instead, the EMG grade value based on the Bland grading scale was extracted from the EMG report and included as a separate variable.
Fig. 3.
Overview of the experimental design and model development.
Model development
Three machine learning algorithms LASSO LR, RF, and GBM were applied to develop the prediction models. LASSO LR is a probabilistic model that incorporates a regularization technique for variable selection36, shrinking some regression coefficients to zero and thereby performing feature selection. This not only facilitates the identification of important features but also reduces model complexity, helping to prevent overfitting37. Random Forest constructs multiple decision trees by randomly sampling the training data and aggregates the outputs of individual trees through majority voting38. The randomness introduced during feature selection and the bagging process contributes to reducing overfitting39. GBM is an ensemble model based on the boosting technique, where weak learners are trained sequentially. It improves performance by adjusting the weights of misclassified data points during the learning process40. Details of the final model hyperparameters are listed in Supplementary Table S2. The entire dataset was split into a training set (75%) and a test set (25%), and threefold cross-validation was performed within the training set to evaluate model performance.
Evaluation measure
The classifier’s performance was evaluated on multiple fronts. First, the overall performance of the classification model was measured using the area under the receiver operating characteristic (AUROC) curve, and differences between models were assessed using DeLong’s test41. The resulting P values were adjusted for multiple comparisons using the Benjamini–Hochberg procedure, with a significance threshold of P < 0.05. In addition, Accuracy, F1 Score, and area under the precision-recall curve (AUPRC) were used to further assess and compare the predictive capabilities of each algorithm. The AUPRC was included specifically to account for the imbalance in outcome prevalence. Moreover, the operating probability threshold used to compute accuracy and F1-score was determined on the validation set by maximizing the Youden index42, and this fixed threshold was subsequently applied to the test set. To interpret the key variables contributing to the model’s predictions, SHAP analysis was conducted. SHAP analysis was based on the GBM model, which demonstrated the highest predictive performance. The relative importance of each variable was calculated and ranked based on the mean absolute SHAP value. This approach aimed to identify the major determinants of the model’s predictions and enhance clinical interpretability. Although SHAP can in principle be applied to all three models, we focused the SHAP analysis on the GBM model because it achieved the highest predictive performance and was therefore selected as the primary model for clinical interpretation. This approach aimed to identify the major determinants of the model’s predictions and enhance clinical interpretability. The methods in the present study were implemented in Python version 3.9.7 (Python Software Foundation, Wilmington, Del, USA), with scikit-learn (version 1.1.2).
Result
General characteristics of the study population
A total of 3602 patients diagnosed with CTS were included in the target population, of whom 696 (19.3%) underwent surgery within 365 days of the later date between their EMG reports and radiology reports. Table 1 presents the demographic characteristics of the patients by surgical status. Among those who underwent surgery, 596 (85.6%) were female, and the mean age of the overall cohort was 58.6 years. The mean age of patients in the surgery group was 58.0 years, compared to 60.8 years in the non-surgery group, showing a statistically significant difference between groups (P < 0.001).
Table 1.
Baseline patient characteristics.
| Characteristics | All (3602) |
No outcome (N = 2906) |
Outcome (N = 696) |
P value |
|---|---|---|---|---|
| Sex (Female), N (%) | 2838 (78.8) | 2242 (77.2) | 596 (85.6) | 0.22 |
| Age group, N (%) | ||||
| 18–29 | 68 (1.9) | 61 (2.1) | 7 (1.0) | 0.4598 |
| 30–39 | 199 (5.5) | 182 (6.3) | 17 (2.4) | 0.6932 |
| 40–49 | 419 (11.6) | 358 (12.3) | 61 (8.8) | 0.1107 |
| 50–59 | 1209 (33.5) | 953 (32.8) | 256 (36.8) | 0.1001 |
| 60–69 | 928 (25.8) | 752 (25.8) | 176 (25.3) | 0.9857 |
| 70–79 | 602 (16.7) | 470 (16.2) | 132 (18.9) | 0.0831 |
| Over 80 | 177 (4.9) | 130 (4.5) | 47 (6.8) | 0.8071 |
| General comorbidities | ||||
| Diabetes mellitus | 164 (4.6) | 130 (4.5) | 34 (5.0) | 0.03 |
| Obesity | 7 (0.2) | 6 (0.2) | 1 (0.1) | 0.42 |
| Osteoarthritis | 441 (12.2) | 339 (11.7) | 102 (14.7) | 0.09 |
| Rheumatoid arthritis | 21 (0.6) | 16 (0.5) | 5 (0.7) | 0.23 |
| Depressive disorder | 84 (2.3) | 66 (2.3) | 18 (2.6) | 0.12 |
| Medication use | ||||
| Antidepressants | 1001 (27.8) | 797 (27.4) | 204 (29.3) | 0.04 |
| Opioids | 968 (26.9) | 782 (26.9) | 186 (26.7) | < 0.001 |
| Antiinflammatory and antirheumatic | 1555 (43.2) | 1,252 (43.1) | 303 (43.5) | < 0.001 |
Model performance
Table 2 summarizes the detailed classification performance according to each model and input variable combination. Across all algorithms, improvements in predictive performance were observed when unstructured text information and the EMG grade variable were incorporated, compared to the baseline model that used only structured CDM-based clinical covariates. For the LASSO LR model, the AUROC increased from 0.746 (95% CI 0.685–0.801) in the baseline model to 0.772 (95% CI 0.723–0.821) in the final model that included radiology report text, EMG report, and the EMG grade variable. Similarly, the AUROC for the RF model increased from 0.750 (95% CI 0.690–0.809) to 0.785 (95% CI 0.727–0.829), and for the GBM, from 0.759 (95% CI 0.711–0.815) to 0.792 (95% CI 0.732–0.830). The calibration plot is shown in Supplementary Fig. S1.
Table 2.
Predictive performance comparison according to input features.
| CDM-based clinical covariate | CDM-based clinical covariate + radiology/EMG report text model | CDM-based clinical covariate + radiology/EMG report text + EMG grade model | |
|---|---|---|---|
| LASSO LR | |||
| AUROC | 0.746 [0.685–0.801] | 0.768 [0.715–0.814] | 0.772 [0.723–0.821] |
| AUPRC | 0.432 [0.341–0.532] | 0.465 [0.357–0.498] | 0.471 [0.366–0.499] |
| Accuracy | 0.782 | 0.801 | 0.808 |
| F1-score | 0.495 | 0.523 | 0.531 |
| RF | |||
| AUROC | 0.750 [0.690–0.809] | 0.779 [0.732–0.821] | 0.785 [0.727–0.829] |
| AUPRC | 0.441 [0.346–0.535] | 0.478 [0.364–0.491] | 0.485 [0.387–0.520] |
| Accuracy | 0.786 | 0.809 | 0.815 |
| F1-score | 0.501 | 0.536 | 0.545 |
| GBM | |||
| AUROC | 0.759 [0.711–0.815] | 0.789 [0.738–0.826] | 0.792 [0.732–0.830] |
| AUPRC | 0.459 [0.363–0.541] | 0.492 [0.384–0.503] | 0.499 [0.382–0.531] |
| Accuracy | 0.794 | 0.818 | 0.823 |
| F1-score | 0.519 | 0.552 | 0.561 |
LASSO LR least absolute shrinkage and selection operator logistic regression, RF random forest, GBM gradient boosting machine, CDM common data model, EMG electromyography.
Topic modeling was performed using LDA on the EMG report and radiology report. The results presented are derived from the GBM model under the CDM-based clinical covariate + radiology/EMG report text + EMG grade experimental setting, which demonstrated the highest predictive performance among the evaluated models. In this setting, clinically important grade-related expressions were first removed from the text and included separately as a categorical variable in the prediction model. After comparing topic numbers set to 3, 5, and 10, the configuration with five topics yielded the highest performance and was therefore used in the final model. The number of topics was set to 3, 5, and 10 for comparison, following approaches commonly used in previous LDA-based text analyses43,44. To determine the optimal number of topics, we compared these configurations using the C_v coherence metric and cross-validated AUROC on the training set (Supplementary Table S3). The 5-topic model achieved the highest coherence (0.56) compared with 0.48 for 3 and 0.54 for 10. In addition, the 5-topic representation yielded the highest cross-validated AUROC. Therefore, 5 was selected for all subsequent analyses. The unstructured data were thus represented by five topics, each labeled by a clinician based on the clinical relevance of the representative keywords. Table 3 presents the topics extracted from the CDM-based clinical covariate + radiology/EMG report text + EMG grade. Topics 1 and 5 captured electrophysiological phenotypes, including sensory dysfunction and severe conduction abnormalities, whereas Topic 2 reflected imaging-based CTS features such as median nerve swelling on ultrasound, and Topic 3 represented alternative neuropathic conditions such as ulnar neuropathy. The detailed results of the CDM-based clinical covariate + radiology/EMG report text model are presented in Supplementary Table S4, and the SHAP analysis of feature importance and directionality is shown in Supplementary Fig. S2.
Table 3.
Topic variables included in CDM-based clinical covariate + radiology/EMG report text + EMG grade.
| No. | Topic | Keywords |
|---|---|---|
| Topic 1 | Electrophysiological evidence of sensory nerve dysfunction | Sensory, CMAP, wave, terminal, latency, decreased, prolonged |
| Topic 2 | Descriptions related to CTS Diagnosis | CTS, wrist, nerve, swelling, median, level, axonotmesis, soft |
| Topic 3 | Non-median neuropathy and alternative diagnoses | Ulnar, neuropathy, elbow, axonal, lesion, active, subchondral, styloid, lunate |
| Topic 4 | Degenerative or bony pathology | Bony, significant, abnormality, diffuse, facet, arthrosis, severe |
| Topic 5 | Conduction delays and pathological electrophysiological findings | Stenosis, latency, amplitude, degenerative, demyelination, abnormalities, findings |
CDM common data model, EMG electromyography, CMAP compound motor action potential, CTS carpal tunnel syndrome.
Feature importance
SHAP analysis was conducted to interpret the contribution of variables in the surgery prediction model (Fig. 4). Through SHAP analysis, the relative importance of each predictor and its directional effect on the likelihood of surgery were evaluated. The EMG grade variable, considered a key clinical indicator, emerged as the most important predictor, exhibiting positive SHAP values that increased with higher EMG grade scores, demonstrating consistent explanatory power within the model. Additionally, among the LDA topic variables, Topic 2, Topic 5, and Topic 1, as well as medication-related variables including tramadol and morphine prescriptions, patient age (ageyear), inpatient visit status, and prescriptions of ephedrine and dexamethasone, were identified as major contributors to the prediction.
Fig. 4.
SHAP value analysis result derived by integrated GBM model using CDM-based clinical covariate + radiology/EMG report text + EMG grade model.
For interpretable model implementation, individual patient data were also examined. For example, Fig. 5 (A) presents the SHAP force plot for a high-risk patient who actually underwent surgery. In this case, the patient had a high EMG grade of 3, and the LDA topics derived from radiology reports and EMG texts (Topic 2, Topic 5, and Topic 1) contributed significantly to the surgery prediction. All these variables increased the predicted probability of surgery. In contrast, Fig. 5B presents the SHAP results for a low-risk patient who did not undergo surgery. In this case, although the value of Topic 1 was 1, both the EMG grade and the values of Topic 5 and Topic 2 were 0, indicating the absence of key variables that increase the likelihood of surgery. Taken together, these characteristics led the model to predict a low probability of surgical intervention.
Fig. 5.
Local SHAP interpretations of the GBM model. (A) shows the force plot for a high-risk case, and (B) shows the force plot for a low-risk case. Red indicates a positive contribution of the feature to the predicted outcome, while blue indicates a negative contribution.
Discussion
In this study, we developed a predictive model for surgical intervention within 365 days in patients with CTS by integratively utilizing structured data based on the OMOP-CDM and unstructured text data extracted from radiology reports and EMG reports. The timing of surgery in CTS varies considerably depending on symptom severity, patient preference, and the duration of conservative management, and many patients transition to surgery only after prolonged non-surgical treatment. Prior studies have similarly shown that a substantial proportion of patients undergo surgical intervention after symptoms persist for more than 6–12 months, indicating that delayed surgical conversion is common45. Based on this evidence, we selected a 365-day prediction window to capture both early and delayed surgeries.
Comparative performance analysis across various feature combinations demonstrated consistent improvements in predictive performance in the integrated model, which included radiology and EMG reports as well as the EMG grade variable, compared to the baseline model using only structured clinical variables.
The GBM model demonstrated the best predictive performance, achieving an AUROC of 0.792 when incorporating unstructured text and EMG grade, compared to 0.759 using only structured CDM variables. This improvement highlights that the inclusion of radiology and EMG report information, along with the EMG severity grade, enhances the model’s ability to capture clinically relevant factors influencing surgical decisions. In addition, improvements in accuracy, AUPRC, and F1-score indicate that the integrated model more effectively balances sensitivity and specificity, supporting its potential utility as an explainable decision-support tool in real-world clinical settings.
To extract meaningful information from unstructured text data, LDA-based topic modeling was applied to radiology reports and EMG reports. This process segregated latent clinical expressions associated with surgery into distinct topics, and the topic distribution of each document was utilized as predictive features. Clinician reviewed the keyword distributions to assign clinically relevant interpretations to each topic. Topic 2 (Descriptions related to CTS diagnosis), Topic 1 (Electrophysiological findings), and Topic 5 (Conduction delays and pathological electrophysiological findings) were found to reflect core information pertinent to actual surgical decision-making. In addition, among the structured variables, prescriptions of tramadol and morphine, patient age, inpatient visit status, and prescriptions of ephedrine and dexamethasone were identified as major contributors. The prominence of tramadol and morphine prescriptions may reflect greater pain severity or inadequate symptom control with conservative treatment. Our findings therefore suggest that prescriptions of strong analgesics may serve as proxy variables that indirectly capture patients with persistent or severe pain who are more likely to progress to surgical treatment. Therefore, tramadol and morphine prescriptions should be interpreted as indicators of symptom burden rather than independent drivers of surgical decision-making.
However, mere inclusion of unstructured text may lead to limited improvements, as topic modeling-based features can remain somewhat generic. Therefore, this study separated the EMG severity information, which is a critical clinical indicator for surgical decisions, from the text and included it as an independent EMG grade variable in the predictive model. This refined EMG grade variable enhanced the model’s sensitivity and interpretability, illustrating the effectiveness of an integrated predictive approach combining clinical knowledge derived from unstructured data with structured clinical indicators. Through this approach, the study validates the effectiveness of a complementary integration of structured clinical indicators and unstructured text. Future extensions of the OMOP-CDM-based data model should consider incorporating such unstructured text and severity indicators.
Previous studies have developed various machine learning models to predict clinical outcomes and severity in CTS patients. Park et al. developed a multiclass classification model using electrophysiologically confirmed CTS data from 1037 cases, classifying severity into mild, moderate, and severe, with Extreme Gradient Boosting (XGB) and RF models achieving accuracies of 76.6% and 75.6%, respectively46. Yetiş et al. constructed models predicting CTS diagnosis based on anthropometric hand measurements, grip strength, and pinch strength, reporting strong performances for RF and XGBoost models at 89.5% and 86.8%, respectively47. Recently, models have been developed not only for CTS diagnosis but also for predicting post-surgical prognosis, symptom changes, and treatment response, expanding the potential utility of clinical decision support tools48–50. However, these previous studies primarily rely on structured clinical data (e.g., age, grip strength, anthropometry, questionnaire scores), with limited reports integrating unstructured text data for predicting surgical intervention.
This study has several limitations. First, since the model was developed and validated using data from a single institution, its generalizability is inherently limited. In particular, EMG test reports are known to exhibit institution-specific reporting styles, terminology, and formatting, which may lead to distribution shifts in the derived topic features when applied to other sites. Although the OMOP-CDM standardizes structured variables, it does not eliminate heterogeneity in unstructured EMG narratives. Therefore, the lack of external, multi-center validation highlights the need for further validation across institutions with different EMG protocols, reporting conventions, and surgical thresholds. Second, due to the inherent nature of unstructured data, radiology reports and EMG reports exhibit heterogeneous sentence structures and varying quality, potentially causing information loss during preprocessing and interpretation. In addition, unrecorded findings in EMG reports may not necessarily indicate true absence but may reflect reporting practices or clinical judgment. However, in CTS, electrophysiologic severity is commonly summarized using the Bland grading scale, which integrates both sensory and motor abnormalities and is widely used to guide surgical decision-making. Findings such as spontaneous muscle activity typically appear only in advanced disease (Bland grades 5–6) and are more relevant for postoperative prognosis than for the decision to proceed with surgery. Therefore, while individual EMG descriptors may be variably documented, the key severity information relevant to surgical decision-making is largely captured by the Bland grade used in this study. Third, the model was evaluated using a random train–test split rather than a temporal validation. Because the cohort spans more than a decade (2010–2022), changes in clinical practice, EMG reporting styles, and surgical thresholds over time may have introduced temporal drift that was not explicitly assessed in this study. As a result, the reported performance may not fully reflect real-world deployment in later calendar periods. Future studies will therefore evaluate model performance across temporally separated cohorts to assess robustness to such drift, because the original text was written in Korean, automated translation into English was required before topic modeling. Although standard preprocessing procedures were applied, automated translation may still introduce subtle distortions in terminology or context that could influence topic distributions and should be considered when interpreting the results. Although a subset of translated reports was manually reviewed and no systematic loss of key clinical terminology was observed, subtle translation-related biases cannot be completely excluded. Fifth, this study did not utilize modern embedding-based methods such as ClinicalBERT or BERTopic, which may have limited the predictive performance of the model. Additionally, the normalization of EMG grade information and topic modeling were performed using rule-based approaches, which require further refinement for automation and real-time application in clinical practice. Future studies will further extend this framework by evaluating shorter prediction horizons (e.g., 30, 90, and 180 days), which would enable time-specific and clinically actionable surgical decision support. Despite these limitations, this study is significant in demonstrating the effective integration of unstructured text data with structured CDM variables to build an explainable and quantitative predictive model for surgical decision-making.
The EMG grade was identified as the most important variable, consistent with existing medical evidence emphasizing the critical role of severity in surgical decision-making. Additionally, unstructured text-based variables including topics 2, 5, and 1, as well as structured CDM variables such as prescriptions of tramadol and morphine, patient age, and inpatient status, were also key contributors. These findings illustrate that structured and unstructured data complement each other, enabling more precise and explainable predictions.
Conclusion
In this study, we developed predictive models to predict surgery in CTS patients by integrating standardized CDM-based structured data with unstructured information extracted from radiology and EMG reports. By applying LDA-based topic modeling and incorporating EMG severity grades, the model achieved improved predictive performance and highlighted the clinical value of unstructured data. These findings highlight the potential of integrated approaches for advancing prediction-based clinical decision support systems that quantitatively utilize unstructured data. Moreover, this study serves as a meaningful example demonstrating the potential for expanding CDM-based research through the incorporation of text data.
Supplementary Information
Below is the link to the electronic supplementary material.
Acknowledgements
This work was supported by a public clinical research grant-in-aid from the Seoul Metropolitan Government Seoul National University (SMG-SNU) Boramae Medical Center (04-2024-0033). This work was also partly supported by the National Research Foundation of KOREA(NRF) grant funded by the Korea government (MSIT) (No. RS-2023-00241887). This study was also partly supported by the NAVER Digital Bio Innovation Research Fund, funded by NAVER Corporation (Grant No. 37-2025-0025).
Author contributions
Ji Hyun Lee had full access to all the data in the study and took responsibility for the integrity of the data and the accuracy of the analysis. Ji Hyun Lee contributed to data analysis, literature review and manuscript writing. Borim Ryu and Yohan Lee contributed to the study design, data collection, writing of the manuscript, and supervision of the study.
Data availability
Because this study utilized a distributed research network, the data are kept within each institution and are not publicly available. However, the source code for cohort and covariates generation is available upon request to corresponding author.
Declarations
Competing interests
The authors declare no competing interests.
Ethics approval
The study protocol was approved by the Institutional Review Board of the study site (IRB No. 40-2024-17), and the study adhered to the principles of the Declaration of Helsinki. The requirements for informed consent from the study participants were waived by the IRB Committee of the SMG-SNU BMC owing to the retrospective study design.
Footnotes
Publisher’s note
Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Borim Ryu and Yohan Lee jointly supervised this work.
Contributor Information
Borim Ryu, Email: borim.ryu@gmail.com.
Yohan Lee, Email: yohanlee@snu.ac.kr.
References
- 1.Chang, Y.-W. et al. Comparative effectiveness of ultrasound and paraffin therapy in patients with carpal tunnel syndrome: A randomized trial. BMC Musculoskelet. Disord.15, 1–7 (2014). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 2.García, B. et al. Carpal tunnel syndrome, generalities, management and treatment. EPRA Int. J. Multidiscip. Res.8, 34–37 (2022). [Google Scholar]
- 3.Gebrye, T. et al. Global and regional prevalence of carpal tunnel syndrome: A meta‐analysis based on a systematic review. Musculoskelet. Care22(4), e70024 (2024). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 4.Rhee, S. Y. et al. Incidence and reappraisal of known risk factors associated with carpal tunnel syndrome: A nationwide, 11-year, population-based study in South Korea. J. Clin. Neurol. (Seoul, Korea)17(4), 524 (2021). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 5.Mekki, Y. M. et al. Applications of artificial intelligence in ultrasound imaging for carpal-tunnel syndrome diagnosis: A scoping review. Int. Orthop.10.1007/s00264-025-06497-1 (2025). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 6.Anwar, I. et al. Hand function among patients with carpal tunnel syndrome. Open J. Ther. Rehabil.7(04), 170 (2019). [Google Scholar]
- 7.Ferraguti, M. S. et al. Effectiveness of the six-item carpal tunnel symptoms scale (CTS-6) questionnaire for the diagnosis of carpal tunnel syndrome. J. Asoc. Argent. Ortop. Traumatol.89(3), 226–232 (2024). [Google Scholar]
- 8.Padua, L. et al. Carpal tunnel syndrome: Clinical features, diagnosis, and management. Lancet Neurol.15(12), 1273–1284 (2016). [DOI] [PubMed] [Google Scholar]
- 9.Sonoo, M. et al. Nerve conduction studies and EMG in carpal tunnel syndrome: Do they add value?. Clin. Neurophysiol. Pract.3, 78–88 (2018). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 10.Fowler, J. R., Gaughan, J. P. & Ilyas, A. M. The sensitivity and specificity of ultrasound for the diagnosis of carpal tunnel syndrome: A meta-analysis. Clin. Orthop. Relat. Res.469, 1089–1094 (2011). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 11.Loos, N. L. et al. Algorithm versus expert: Machine learning versus surgeon-predicted symptom improvement after carpal tunnel release. Neurosurgery95(1), 110–117 (2024). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 12.Öten, E., Bilecik, N. A. & Uğur, L. Use of machine learning methods in diagnosis of carpal tunnel syndrome. Comput. Methods Biomech. Biomed. Eng.10.1080/10255842.2024.2417200 (2024). [DOI] [PubMed] [Google Scholar]
- 13.Hossain, M. R. et al. Natural language processing (NLP) in analyzing electronic health records for better decision making. J. Comput. Sci. Technol. Stud.6(5), 216–228 (2024). [Google Scholar]
- 14.Sezgin, E. et al. Extracting medical information from free-text and unstructured patient-generated health data using natural language processing methods: Feasibility study with real-world data. JMIR Formative Res.7, e43014 (2023). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 15.Ye, J., et al. Development and application of natural language processing on unstructured data in hypertension: A scoping review. medRxi 2024–02 (2024).
- 16.Kayi, E. S., et al. Topic modeling for classification of clinical reports. arXiv preprint https://arxiv.org/abs/1706.06177 (2017).
- 17.Geletta, S., Follett, L. & Laugerman, M. Latent Dirichlet allocation in predicting clinical trial terminations. BMC Med. Inform. Decis. Mak.19, 1–12 (2019). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 18.Danler, M., et al. Visualizing nursing narratives: An Evaluation of latent Dirichlet allocation topic modeling for care reports. In Digital Health and Informatics Innovations for Sustainable Health Care Systems, 1709–1713 (IOS Press, 2024). [DOI] [PubMed]
- 19.Gan, S. et al. Enhancing readmission prediction models by integrating insights from home healthcare notes: Retrospective cohort study. Int. J. Nurs. Stud.158, 104850 (2024). [DOI] [PubMed] [Google Scholar]
- 20.Huang, Y.-Z. et al. A nursing note-aware deep neural network for predicting mortality risk after hospital discharge. Int. J. Nurs. Stud.156, 104797 (2024). [DOI] [PubMed] [Google Scholar]
- 21.Chiu, C.-C. et al. Predicting ICU readmission from electronic health records via BERTopic with long short term memory network approach. J. Clin. Med.13(18), 5503 (2024). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 22.Aalaie, B. et al. Development and validation of a clinical model for predicting the severity of carpal tunnel syndrome. Mod. Rheumatol.34(4), 851–857 (2024). [DOI] [PubMed] [Google Scholar]
- 23.Jansen, M. C. et al. Predicting clinical outcome after surgical treatment in patients with carpal tunnel syndrome. J. Hand Surg.43(12), 1098–1106 (2018). [DOI] [PubMed] [Google Scholar]
- 24.Edgell, S. E. et al. Predicting the outcome of carpal tunnel release. J. Hand Surg.28(2), 255–261 (2003). [DOI] [PubMed] [Google Scholar]
- 25.Xu, D. et al. Data-driven deep learning for predicting ligament fatigue failure risk mechanisms. Int. J. Mech. Sci.10.1016/j.ijmecsci.2025.110519 (2025). [Google Scholar]
- 26.Selcuk, S. Y. et al. Automated HER2 scoring in breast cancer images using deep learning and pyramid sampling. BME Front.5, 0048 (2024). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 27.Luu, J. et al. Practical guide to building machine learning-based clinical prediction models using imbalanced datasets. Trauma Surg. Acute Care Open10.1136/tsaco-2023-001222 (2024). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 28.OHDSI-observational health data sciences and informatics. https://www.ohdsi.org/ (2020).
- 29.Hripcsak, G., et al. Observational health data sciences and informatics (OHDSI): Opportunities for observational researchers. In MEDINFO 2015: eHealth-Enabled Health, 574–578 (IOS Press, 2015). [PMC free article] [PubMed]
- 30.Schuemie, M., et al. FeatureExtraction: Generating Features for a Cohort (2024).
- 31.Reps, J. M. et al. Design and implementation of a standardized framework to generate and evaluate patient-level prediction models using observational healthcare data. J. Am. Med. Inform. Assoc.25(8), 969–975 (2018). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 32.Bland, J. D. P. A neurophysiological grading scale for carpal tunnel syndrome. Muscle Nerve Off. J. Am. Assoc. Electrodiagn. Med.23(8), 1280–1283 (2000). [DOI] [PubMed] [Google Scholar]
- 33.Blei, D. M., Ng, A. Y. & Jordan, M. I. Latent Dirichlet allocation. J. Mach. Learn. Res.3(Jan), 993–1022 (2003). [Google Scholar]
- 34.Jelodar, H. et al. Latent Dirichlet allocation (LDA) and topic modeling: Models, applications, a survey. Multimed. Tools Appl.78, 15169–15211 (2019). [Google Scholar]
- 35.Chen, J. H. et al. Predicting inpatient clinical order patterns with probabilistic topic models vs conventional order sets. J. Am. Med. Inform. Assoc.24(3), 472–480 (2017). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 36.Meier, L., Van De Geer, S. & Bühlmann, P. The group lasso for logistic regression. J. R. Stat. Soc. B Stat. Methodol.70(1), 53–71 (2008). [Google Scholar]
- 37.Dhanka, S &, Maini, S. Multiple machine learning intelligent approaches for the heart disease diagnosis. In IEEE EUROCON 2023—20th International Conference on Smart Technologies (IEEE, 2023).
- 38.Breiman, L. Random forests. Mach. Learn.45, 5–32 (2001). [Google Scholar]
- 39.Lee, C. et al. Chronic disease prediction using the common data model: Development study. JMIR AI1(1), e41030 (2022). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 40.Bühlmann, P. & Hothorn, T. Boosting Algorithms: Regularization, Prediction and Model Fitting, 477–505 (2007).
- 41.DeLong, E. R., DeLong, D. M. & Clarke-Pearson, D. L. Comparing the areas under two or more correlated receiver operating characteristic curves: A nonparametric approach. Biometrics10.2307/2531595 (1988). [PubMed] [Google Scholar]
- 42.Youden, W. J. Index for rating diagnostic tests. Cancer3(1), 32–35 (1950). [DOI] [PubMed] [Google Scholar]
- 43.Zhao, W. et al. A heuristic approach to determine an appropriate number of topics in topic modeling. BMC Bioinform.16(Suppl 13), S8 (2015). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 44.Gan, J. & Qi, Y. Selection of the optimal number of topics for LDA topic model—Taking patent policy analysis as an example. Entropy23(10), 1301 (2021). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 45.Masud, M. et al. Does the duration and severity of symptoms have an impact on relief of symptoms after carpal tunnel release?. J. Brachial Plexus Peripher. Nerve Inj.14(01), e1–e8 (2019). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 46.Park, D. et al. Machine learning-based approach for disease severity classification of carpal tunnel syndrome. Sci. Rep.11(1), 17464 (2021). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 47.Yetiş, M. et al. Carpal tunnel syndrome prediction with machine learning algorithms using anthropometric and strength-based measurement. PLoS ONE19(4), e0300044 (2024). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 48.Harrison, C. J. et al. Developing machine learning algorithms to support patient-centered, value-based carpal tunnel decompression surgery. Plast. Reconstruct. Surg. Glob. Open10(4), e4279 (2022). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 49.Elseddik, M. et al. Predicting CTS diagnosis and prognosis based on machine learning techniques. Diagnostics13(3), 492 (2023). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 50.Inui, A. et al. Prediction of electrophysiological severity and carpal tunnel syndrome instrument changes after carpal tunnel release using machine learning model. Appl. Sci.15(4), 1812 (2025). [Google Scholar]
Associated Data
This section collects any data citations, data availability statements, or supplementary materials included in this article.
Supplementary Materials
Data Availability Statement
Because this study utilized a distributed research network, the data are kept within each institution and are not publicly available. However, the source code for cohort and covariates generation is available upon request to corresponding author.





