Heart disease—including coronary artery disease, myocardial infarction, heart failure, and stroke—remains a leading cause of morbidity and mortality worldwide. Hypertension and diabetes are prominent, frequently co-occurring risk factors that amplify vascular damage, accelerate atherosclerosis, and raise the likelihood of cardiac events. Identifying and monitoring these risk factors supports early intervention and tailored management.
Information about risk factors and complications is often recorded as unstructured free text in electronic health records (EHRs), which hinders automated retrieval. Advances in text mining and natural language processing enable extraction of clinically relevant details from narratives, offering an opportunity to integrate unstructured and structured data for improved risk detection and decision support.
This research integrates two complementary datasets to build a multimodal pipeline for classifying the presence or absence of heart disease as a complication of hypertension and diabetes. The PrevComp corpus contains 274 deidentified clinical notes drawn from the i2b2/UTHealth 2014 Heart Disease Risk Factors corpus; these records focus on patients known to have both hypertension and diabetes and are annotated for complications (macrovascular and microvascular).
The UCI Heart Disease dataset comprises data from 303 patients referred for coronary angiography at the Cleveland Clinic. It provides 13 structured features commonly used for heart disease prediction (for example, age, sex, chest pain type, resting blood pressure, serum cholesterol, fasting blood sugar, resting ECG results, maximum heart rate, exercise-induced angina, ST depression/old peak, slope of ST segment, number of major vessels, and thalassemia).
The study’s aim is to map unstructured narrative content to structured feature values so that a model trained on the UCI structured dataset can be applied to PrevComp clinical records, thereby enabling automated detection of heart disease in patients with hypertension and diabetes.
The UCI dataset was split into training (60%), validation (20%), and test (20%) partitions. Ensemble algorithms—LightGBM, XGBoost, CatBoost, and random forest—were trained under identical conditions. Hyperparameter tuning used exhaustive GridSearchCV with threefold stratified cross-validation; selection was based on the highest mean F1 score across folds. The hyperparameter grids were explicitly enumerated rather than searched randomly or with Bayesian methods.
Among the compared tree-based approaches, LightGBM achieved the best results under these experimental settings. The UCI-trained LightGBM model became the reference classifier for mapping structured risk-factor inputs to presence/absence of heart disease.
PrevComp clinical notes are unstructured and lack many numerical structured attributes present in the UCI dataset. To convert each note into a representation that could be used downstream, the authors tokenized notes and passed them through ClinicalBERT, extracting the 768-dimensional CLS token embedding from the final hidden layer as a fixed-length vector representation for each document.
Because no ground-truth structured labels were available for PrevComp notes, a large language model (Meta-Llama-3.1) was employed to produce weakly supervised labels for each note. These weak labels served as surrogate structured targets enabling the application and evaluation of the UCI-trained classifier on PrevComp-derived features.
The overall pipeline maps unstructured clinical narratives into structured-like feature vectors using ClinicalBERT-derived embeddings and weakly supervised label generation. These derived features are then fed into the UCI-trained LightGBM classifier to predict the presence or absence of heart disease in each PrevComp record. Experiments were implemented in Python and executed on Google Colab with 25 GB of RAM available.
The integrated multimodal approach demonstrated an overall predictive accuracy of 83% for classifying the presence versus absence of heart disease. This result supports the feasibility of extracting risk-factor information from narrative clinical text and mapping it into structured feature spaces for classification by a model trained on conventional structured datasets.
Prior work in cardiovascular risk prediction has often relied on unimodal inputs—either structured EHR features or unstructured narrative text. Tree-based gradient boosting models (for example, XGBoost, LightGBM, CatBoost) are well established for structured medical classification tasks because of their ability to handle heterogeneous features and missing values. Transformer-based models and clinical-domain pretrained language models (for example, ClinicalBERT) have made it possible to capture semantic information from clinical narratives.
This study differs from previous work by combining both modalities: the PrevComp free-text corpus was used for the first time to classify records by the presence or absence of heart disease, and ClinicalBERT-derived representations were mapped to the structured feature space of the UCI dataset so that a LightGBM classifier trained on structured data could be applied to narrative records.
The PrevComp corpus contains narrative mentions and annotations of complications but lacks many demographic and numerical lab values present in the UCI dataset, necessitating transformation and weak supervision. The study relied on a large language model (Meta-Llama-3.1) to generate weak labels because ground-truth structured labels were not available for PrevComp notes; details of the weak-supervision process beyond the use of Meta-Llama-3.1 are not reported here.
All experiments were run in Python on Google Colab with 25 GB of RAM. The authors report that relevant data are available on Kaggle at the cited repositories for the UCI heart disease data and the PrevComp corpus, supporting reproducibility of data access and follow-up experiments.
Mapping unstructured clinical narratives to structured risk-factor features and applying a LightGBM classifier trained on the UCI dataset achieved an overall accuracy of 83% for predicting the presence or absence of heart disease in patients with hypertension and diabetes. The approach demonstrates the potential value of multimodal fusion—integrating NLP-derived features from free text with structured-model training—to support automated screening and risk detection in cardiovascular care. Further work is needed to detail the weak-label generation process and to evaluate performance across larger and more diverse clinical populations.