## 4 Discussion  
### Principal Findings  
Our research presents a notable contribution to the field through the application of BERTopic technology in analyzing EHR text data, generating thematic variables relevant to mortality prediction. The integration of both quantitative and textual clinical records allowed us to develop machine-learning models specifically designed for predicting the mortality rate of HF patients in the ICU. We further explored the importance of variable generation through machine-learning methods, offering insights into crucial factors influencing patient mortality and facilitating the identification of potential preventive measures in medical practice. For the construction of our predictive model targeting HF patients, a 10-fold cross-validation method was employed to forecast outcomes at intervals of 3 days, 30 days, and 365 days. The model incorporated data from the 24 h preceding ICU admission, including physicians' treatment plans and test records. The rigorous evaluation of model performance through various statistical analyses, presented in Table 2 with AUROC values, highlighted the effectiveness of six machine-learning methods. The evaluation of incorporating BERTopic topics on mortality prediction revealed that the inclusion of textual discharge summaries significantly improved the accuracy of mortality rate predictions. Our study demonstrated the effectiveness of models integrating both quantitative and textual data, outperforming those relying solely on quantitative data. Notably, XGBoost, LightGBM, and Bagging emerged as superior models for predicting mortality rates at different time intervals. This integration offers a comprehensive approach to mortality prediction, providing valuable support for clinicians in making informed decisions to enhance patient outcomes in the ICU setting. The variable importance analysis, as depicted in Table 5, underscored the significance of both quantitative and qualitative data in mortality prediction for HF patients in the ICU. The application of the BERTopic method revealed valuable insights within qualitative data, offering crucial support for clinicians in critical decision-making [33]. The comparison of variable importance across different prediction periods emphasized the nuanced factors influencing patient outcomes. Our study strongly suggests that the integration of both quantitative and qualitative data significantly improves the precision of mortality prediction for ICU patients with HF. \begin{table}
\begin{tabular}{c c c c c} \hline \hline  & \begin{tabular}{c} **Feature** \\ **Importance** \\ \end{tabular} & **3 Days** & **30 Days** & **365 Days** \\ \hline \multirow{9}{*}{\
\begin{tabular}{c} Without \\ qualitative data \\ \end{tabular} } & 1 & X\({}_{17}\) & X\({}_{4}\) & X\({}_{4}\) \\  & 2 & X\({}_{12}\) & X\({}_{17}\) & X\({}_{8}\) \\  & 3 & X\({}_{1}\) & X\({}_{7}\) & X\({}_{17}\) \\  & 4 & X\({}_{7}\) & X\({}_{13}\) & X\({}_{7}\) \\ \cline{1-1}  & 5 & X\({}_{4}\) & X\({}_{12}\) & X\({}_{12}\) \\ \cline{1-1}  & 6 & X\({}_{13}\) & X\({}_{3}\) & X\({}_{5}\) \\ \cline{1-1}  & 7 & X\({}_{6}\) & X\({}_{1}\) & X\({}_{13}\) \\ \cline{1-1}  & 8 & X\({}_{9}\) & X\({}_{8}\) & X\({}_{3}\) \\ \cline{1-1}  & 9 & X\({}_{5}\) & X\({}_{5}\) & X\({}_{1}\) \\ \cline{1-1}  & 10 & X\({}_{8}\) & X\({}_{10}\) & X\({}_{6}\) \\ \hline \hline \multirow{9}{*}{
\begin{tabular}{c} With \\ qualitative data \\ \end{tabular} } & 1 & X\({}_{17}\) & X\({}_{12}\) & X\({}_{7}\) \\  & 2 & TOPIC 3 & X\({}_{7}\) & X\({}_{8}\) \\ \cline{1-1}  & 3 & TOPIC 1 & X\({}_{17}\) & X\({}_{1}\) \\ \cline{1-1}  & 4 & X\({}_{12}\) & X\({}_{4}\) & X\({}_{13}\) \\ \cline{1-1}  & 5 & X\({}_{1}\) & X\({}_{3}\) & X\({}_{3}\) \\ \cline{1-1}  & 6 & X\({}_{7}\) & X\({}_{14}\) & X\({}_{12}\) \\ \cline{1-1}  & 7 & X\({}_{6}\) & TOPIC 1 & X\({}_{4}\) \\ \cline{1-1}  & 8 & X\({}_{8}\) & X\({}_{8}\) & X\({}_{17}\) \\ \cline{1-1}  & 9 & X\({}_{9}\) & X\({}_{1}\) & TOPIC 1 \\ \cline{1-1}  & 10 & X\({}_{13}\) & TOPIC 2 & X\({}_{5}\) \\ \hline \hline \end{tabular}
\end{table}