Attention-guided hybrid transformer-ensemble framework for emotional vulnerability detection in cancer patient and caregiver narratives
Understanding the emotional vulnerability of cancer patients and caregivers is critical for improving psychological support and clinical intervention strategies. With the rapid growth of online health communities, large volumes of textual narratives describing treatment experiences and emotional struggles have become available for computational analysis. However, accurately capturing emotional intensity and contextual sentiment in such narratives remains challenging due to the complex linguistic patterns present in health-related discussions. This study proposes an attention-guided hybrid transformer-ensemble learning framework for emotional vulnerability detection in cancer-related social media posts. The proposed architecture integrates domain-adapted contextual representations generated by BioBERT with linguistic intensity features to capture both semantic context and emotional strength. An attention-based feature fusion mechanism dynamically combines these heterogeneous features to produce enriched representations of patient narratives. The fused representations are subsequently utilized by multiple optimized machine learning classifiers, including XGBoost, LightGBM, Random Forest, and CatBoost. Hyperparameter optimization is performed using the Optuna framework to improve predictive performance. Furthermore, ensemble learning strategies such as soft voting, hard voting, and stacking are employed to combine the predictions of the base classifiers. Experiments conducted on a held-out split of a publicly available dataset of 10,391 posts from cancer patients and caregivers demonstrate that ensemble approaches consistently outperform individual classifiers on this data. The stacking ensemble achieves an accuracy of 0.76 and an ROC-AUC of 0.91, outperforming its own individual base classifiers but not a fine-tuned BioBERT baseline (accuracy 0.77, ROC-AUC 0.92) evaluated on the same split; a TF-IDF with linear SVM baseline is also competitive (accuracy 0.763). The framework’s practical advantage over full BioBERT fine-tuning is therefore computational rather than purely predictive: it reuses frozen BioBERT features and adds a lightweight, interpretable attention-fusion and tree-ensemble stage at a fraction of the training cost, while an ablation study confirms that the attention-based fusion of contextual and lexical-intensity signals meaningfully outperforms either signal alone or their simple concatenation. The proposed framework thus provides a scalable, lower-cost computational approach that can support mental health monitoring and early intervention systems in online healthcare communities, at a modest accuracy cost relative to full transformer fine-tuning.
Authors
- Md. Siam Ansary (ORCID: https://orcid.org/0000-0002-4942-2541)
Institutions
- Ahsanullah University of Science and Technology (BD)
Publication Details
- Journal
- Discover Informatics
- Published
- 2026-10-14
- DOI
- https://doi.org/10.1007/s44564-026-00028-9
- Primary Topic
- Mental Health via Writing
- Type
- article
- Field-Weighted Citation Impact
- 0.00