A contextual hierarchical attention network for detecting mental health disorders using social media

Growing parts of the population suffer from mental health problems and psychologists lack capacity to diagnose, let alone treat, all those in need of it. Given recent advancements in the field, deep learning-based NLP techniques could help by detecting those in need of help based on their written text. To this end, this work improves the current state-of-the-art Hierarchical Attention Network (HAN) model by incorporating contextual awareness through BERT-based word embeddings and a multi-head self-attention user-encoder yielding the Context-HAN model. When trained and tested on the eRisk data sets on Self-Harm, Anorexia, and Depression, Context-HAN outperformed the HAN model across all data sets based on various evaluation measures. Furthermore, we find and discuss some interesting insights from analysis of the attention scores, such as that longer and more recently written posts are more important for classification. This work shows the potential of attention mechanisms to leverage contextual information to improve the effectiveness of NLP methods at detecting mental health disorders from user-written text.

Authors

Institutions

Publication Details

Journal
Data & Knowledge Engineering
Published
2026-01-22
DOI
https://doi.org/10.1016/j.datak.2026.102560
Primary Topic
Mental Health via Writing
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

A contextual hierarchical attention network for detecting mental health disorders using social media

Flavius Frăsincar, Ron Hochstenbach, Jasmijn Klinkhamer
Data & Knowledge Engineering
Mental Health via Writing
article

A contextual hierarchical attention network for detecting mental health disorders using social media

Flavius Frăsincar, Ron Hochstenbach, Jasmijn Klinkhamer
article en

Abstract

Growing parts of the population suffer from mental health problems and psychologists lack capacity to diagnose, let alone treat, all those in need of it. Given recent advancements in the field, deep learning-based NLP techniques could help by detecting those in need of help based on their written text. To this end, this work improves the current state-of-the-art Hierarchical Attention Network (HAN) model by incorporating contextual awareness through BERT-based word embeddings and a multi-head self-attention user-encoder yielding the Context-HAN model. When trained and tested on the eRisk data sets on Self-Harm, Anorexia, and Depression, Context-HAN outperformed the HAN model across all data sets based on various evaluation measures. Furthermore, we find and discuss some interesting insights from analysis of the attention scores, such as that longer and more recently written posts are more important for classification. This work shows the potential of attention mechanisms to leverage contextual information to improve the effectiveness of NLP methods at detecting mental health disorders from user-written text.

Data & Knowledge EngineeringVol. 163
Erasmus University Rotterdam (NL)
Quality Education
Openalex Percentile: Top 84%
Mental Health via Writing
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.