Next Article in Journal
A Lightweight Double-Ring Hybrid Sparse NTRU (DRH-SNTRU) Scheme for Secure and Real-Time Communication in the Internet of Vehicles (IoV)
Previous Article in Journal
Least-Privilege Role-Based Access Control Improvement for Cloud Container Security
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Explainable and Computationally Efficient NLP Framework for Detecting Psycho-Emotional Risk Signals in Social Media

by
Orazmukhamed Bekmurat
1,
Darkhan Akpanbetov
2,
Ainur Tursynkhan
3,
Laura Demeubayeva
3,
Zhansaya Duisenbekkyzy
4,
Kanibek Sansyzbay
5,*,
Shingis Kadirkulov
6,* and
Yelena Bakhtiyarova
5
1
Department of Cybersecurity, Information Processing and Storage, Satbayev University, Almaty 050000, Kazakhstan
2
Department of Smart Technologies in Engineering, International Engineering and Technological University, Almaty 050060, Kazakhstan
3
Department of Software Engineering, International Engineering and Technological University, Almaty 050060, Kazakhstan
4
Department of Information Systems, Al-Farabi Kazakh National University, Almaty 050040, Kazakhstan
5
Department of Radio Engineering, Electronics and Telecommunications, International Information Technologies University, Almaty 050040, Kazakhstan
6
Department of the Educational and Methodological Directorate, Sagadat Nurmagambetov Military Institute of the Ground Forces, Almaty 050030, Kazakhstan
*
Authors to whom correspondence should be addressed.
Computers 2026, 15(5), 327; https://doi.org/10.3390/computers15050327
Submission received: 3 April 2026 / Revised: 16 May 2026 / Accepted: 19 May 2026 / Published: 21 May 2026
(This article belongs to the Section Human–Computer Interactions)

Abstract

The timely detection of psycho-emotional risks has become increasingly important due to the rapid growth of social media platforms. This study examines user-generated text as a potential source of early indicators of psychological vulnerability. The proposed NLP-based framework incorporates behavioral features to improve the interpretation of users’ psycho-emotional states. In addition to text classification, the study considers structured behavioral indicators to support psycho-emotional risk analysis. Particular attention is given to interpretability. SHAP-based techniques are applied to reveal the contribution of individual features and to provide a clearer explanation of model predictions. The evaluation was conducted on publicly available datasets containing textual data and aggregated behavioral/physiological indicators. No raw physiological streams, wearable sensor data, or biometric recordings were used. The two datasets were employed in complementary experimental settings and were not aligned at the individual-sample level; accordingly, the broader analytical perspective explored in this study should not be interpreted as a single end-to-end or fully aligned multimodal learning framework. The proposed BERT-based model with SHAP interpretability achieved an accuracy of 96.3%, an F1-score of 0.96, and a ROC–AUC score of 0.98, showing consistent improvement over baseline models, including Random Forests and Support Vector Machines.

1. Introduction

In recent years, psycho-emotional instability among adolescents and young adults has become a significant public health concern [1]. This trend is linked to the rapid growth of digital communication platforms, where users actively share personal experiences and emotions. As a result, the growing amount of user-generated textual data creates new opportunities for identifying early signals of emotional distress and psychological vulnerability [2]. Timely detection of such signals is essential for developing preventive strategies in mental health. Conventional assessment approaches, including clinical interviews and standardized questionnaires, remain important; however, their applicability is often limited in large-scale and continuous monitoring scenarios. In contrast, digital platforms provide a continuous stream of behavioral and linguistic data that can support automated risk detection [3]. Earlier studies mainly relied on traditional machine learning methods, such as logistic regression, support vector machines, and random forest models. These approaches typically depend on predefined linguistic features or domain-specific lexicons. While they demonstrate good performance in structured settings, their ability to capture complex semantic relationships and contextual nuances remains limited [4]. Advances in deep learning introduced architectures such as convolutional neural networks (CNN), recurrent neural networks (RNN), and long short-term memory (LSTM) models, which improved sequential language modeling [5]. Nevertheless, these models often struggle with capturing long-range dependencies in text.
More recently, transformer-based architectures, including BERT and its variants, have significantly advanced natural language processing tasks. By leveraging attention mechanisms, these models capture contextual relationships more effectively of contextual relationships across entire text sequences, leading to improved interpretation of both semantic and emotional content. Consequently, transformer-based approaches have become widely adopted in mental health-related text analysis [6].
Despite these developments, several challenges persist. A considerable proportion of existing models operate as black-box systems, which complicates their practical use in sensitive domains such as mental health due to limited interpretability. In addition, many studies rely on unimodal data, primarily textual information, which does not fully reflect the complexity of psycho-emotional states [7]. The availability of high-quality annotated datasets also remains constrained, particularly in multilingual and resource-limited contexts [8]. Ethical considerations, including privacy protection, data security, and fairness, further complicate the development and deployment of such systems. Biases present in training data may lead to reduced generalization across demographic groups, emphasizing the importance of transparent and responsible AI practices [9].
In this context, the present study proposes an interpretable and computationally efficient framework for detecting psycho-emotional risk signals in social media data. The approach integrates transformer-based language models with explainable AI techniques, which enable accurate predictions and provide additional insight into the decision-making process [10]. In addition, the study explores whether structured behavioral indicators from a separate public dataset can support psycho-emotional risk analysis [11]. The datasets were analyzed separately rather than as a jointly aligned multimodal corpus. The overall architecture of the proposed framework is illustrated in Figure 1. The main contributions of this study can be summarized as follows [12]:
  • development of an interpretable NLP-based framework for detecting psycho-emotional risk signals in social media text;
  • integration of SHAP-based explainability techniques to improve the transparency of model predictions;
  • exploratory analysis of additional structured behavioral indicators derived from a complementary public dataset;
  • experimental validation using publicly available datasets, including comparison with conventional machine learning and deep learning baseline models.
The workflow includes social media and digital data collection, text preprocessing, transformer-based contextual feature extraction, explainable AI analysis, and final risk classification. Colored nodes in the transformer block schematically represent learned contextual feature representations, while the colored bars in the explainable AI block indicate relative feature contribution or importance scores used for interpretation.
In addition to demonstrating robust predictive accuracy, the proposed framework was evaluated for practical efficiency, particularly in terms of inference latency and memory usage under the experimental hardware setting. Reducing inference time and memory consumption is essential for practical use in large-scale social media monitoring, where real-time data processing is required.

Paper Organization

The paper is organized according to the proposed methodology and experimental workflow. The following sections present the theoretical foundation of the research, describe in detail the architectural features of the implemented system, and present the analysis results.
Section 2 reviews previous studies related to psycho-emotional risk detection. The main focus here is on global experience in applying natural language processing methods to identify and validate signs of psycho-emotional risk. Particular attention is paid to the limitations of the existing approaches employed in this field of research. Section 3 presents the materials and methods, including the system architecture, mathematical formulation, broader analytical framework, datasets, and experimental setup. Section 4 reports the experimental results and their comparative analysis, including baseline comparisons, model configuration analysis, efficiency-related evaluation, and interpretability findings. Section 5 discusses the limitations, broader implications, and ethical considerations associated with the proposed framework. Section 6 concludes the paper by summarizing the main findings and outlining directions for future research.

2. Related Work

Over the past decade, natural language processing (NLP) methods have been increasingly used to detect signs of psychological distress and suicidal intent in textual communication. This field lies at the intersection of several disciplines, including computational linguistics, digital medicine, and mental health analytics. The rapid expansion of social media and online communication platforms has contributed to the development of this field. As a result, the digital environment has become a source of large amounts of user-generated text, which researchers are increasingly considering as valuable material for analyzing users’ emotional states and behavioral responses. The digital environment increasingly reflects users’ personal experiences, emotional states, and manifestations of psychological vulnerability. Researchers increasingly use computational methods to analyze large amounts of text data from social networks, medical records, and crisis psychological assistance services. However, despite the significant potential of such approaches for the early detection of psychological problems, a number of methodological and ethical issues remain unresolved in this area [13].
In the early stages of development, this area of research relied primarily on classical machine learning algorithms used to analyze texts related to mental health. In particular, logistic regression models, support vector machines (SVMs), and random forest algorithms were widely used to identify linguistic patterns associated with emotional tension and psychological discomfort in social media posts and clinical records. These models were typically based on predefined features, including lexical n-grams, emotional lexicons, and specialized psychological terminology dictionaries. Although such approaches demonstrated high classification accuracy—usually at the level of 80–90%—their ability to identify complex semantic relationships and contextual features of natural language remained limited. Advances in deep learning have significantly improved this field. Transformer-based architectures, including BERT-type models and other contextual language models, have shown strong performance in analyzing complex language structures and interpreting the contextual meaning of text. The use of contextual vector representations allows such models to more accurately convey the emotional nuances of statements found in digital communication. Modern research shows that transformer-based architectures demonstrate competitive performance compared to earlier NLP methods in many natural language processing tasks. One of their key advantages is the ability to account for complex contextual relationships and semantic dependencies between words and text fragments, even when they are located at significant distances across large text corpora [14].
At the same time, the field of clinical text data analysis is actively developing. Electronic medical records, psychiatric reports, and transcripts of remote consultations with specialists contain valuable information about a patient’s condition. A number of studies apply natural language processing methods to such documents to identify hidden indicators of emotional distress, including possible signs of psycho-emotional risk or a tendency toward self-harmful behavior. Recent studies indicate that automated analysis of clinical texts is becoming an important addition to traditional diagnostics, enabling the extraction of significant indicators from large volumes of medical documentation that might otherwise go unnoticed [15,16].
The evolution of deep learning architectures in general has significantly expanded the horizons of mental health monitoring systems. Today, a wide range of neural network models are used in scientific work: from recurrent (RNN) and convolutional (CNN) networks to transformers. These tools enable the recognition of subtle emotional and semantic patterns in users’ posts on forums and social networks. As reviews of the current literature show, advanced NLP models have shown strong effectiveness in identifying linguistic markers of emotional instability [17]. Moreover, large language models (LLMs) are now also used to extract social health factors from the digital environment, which allows additional contextual factors to be taken into account when predicting psycho-emotional risks [18,19].
The scientific community pays particular attention to the search for signs directly or indirectly related to suicidal intentions and emotional burnout. An analysis of social media posts reveals that certain linguistic constructs can act as indicators of heightened psychological vulnerability. In particular, user texts often contain expressions associated with feelings of hopelessness, loneliness, or emotional exhaustion. Such lexical and semantic elements can be considered early warning signs of an unfavorable psycho-emotional state. Modern research employs sentiment analysis, semantic feature extraction, and deep learning algorithms to identify such indicators. The combined use of these approaches allows for the development of classification models capable of recognizing warning signs in digital communication at early stages of their manifestation [20].
The results of comparative studies generally demonstrate a consistent trend: deep learning models tend to be more effective than classical machine learning algorithms in identifying signs of psychological distress in text data. This is primarily due to the ability of neural network architectures to account for contextual features of language and identify subtle semantic and emotional dependencies between text elements. Such dependencies are often difficult to formalize as predefined features, as is traditionally done in classical models [21].
At the same time, the effectiveness of modern text analysis methods is largely determined by the availability of sufficiently large and well-labeled datasets. In mental health research, such resources remain limited, creating additional challenges in training and subsequent validation of models. Special attention is paid to research related to adolescent mental health. Analysis of online communication among young users shows that machine learning models trained on social media data can identify linguistic patterns that precede the development of severe psychological crises. At the same time, combined analysis methods that combine text tone analysis with deep learning architectures demonstrate higher predictive accuracy compared to approaches based on a single analytical technique [22,23].
In clinical practice, machine learning methods are also used to analyze text descriptions obtained during patient interviews, specialist consultations, and medical facility reports. The main goal of such research is to support specialists in identifying individuals at increased risk of psychological crisis through automated analysis of textual descriptions of patients’ emotional states and behavioral characteristics [24].
Despite the results achieved, the development of systems for identifying psycho-emotional risk based on natural language processing methods still faces several serious difficulties. One of the factors that continues to hinder progress in this area of research is the limited and insufficient variety of training datasets. In many studies, models are trained on relatively small or narrowly specialized text collections. Such samples, as a rule, do not reflect the full range of linguistic forms characteristic of real communication [25]. Systems trained on such datasets often demonstrate limited ability to generalize and encounter difficulties when applying the systems in new situations or different social environments. The issue of the lack of interpretability of the models also remains. Despite high accuracy rates, the logic behind the decisions made by such systems is often insufficiently transparent. For this reason, their work is often described as functioning according to the principle of a ‘black box’. In tasks related to analyzing a person’s mental state, this aspect is particularly important, as it is crucial for specialists to understand which data characteristics formed the basis for the algorithm’s conclusions. Today, the limited ability to interpret such models is seen as one of the factors that limit the wider use of artificial intelligence in the field of computer science [26].
However, ethical issues also play an important role. Working with data reflecting a person’s psychological state requires strict adherence to confidentiality principles and responsible handling of information. A particular challenge is the potential for bias in the training samples. If such biases are present, the algorithm may generate inaccurate predictions for certain social or demographic groups, ultimately eroding trust in automated analysis tools. For this reason, modern research is increasingly focusing on developing machine learning methods that prioritize the protection of personal data and transparent information processing.
Recent studies suggest that multimodal approaches may improve risk assessment. Unlike systems based exclusively on text analysis, these models use several sources of information simultaneously. These may include text messages, speech characteristics, user activity parameters, or various biometric indicators. The combined analysis of different types of data allows for a more comprehensive understanding of a person’s emotional and psychological state.
Implementing multimodal systems remains challenging. The main difficulties stem from the need to integrate heterogeneous data sources, synchronize various information flows, and meet the high requirements for computing resources [27,28].
Additional restrictions are imposed by current standards and dataset limitations. In many cases, the available text corpora are limited to a few languages and do not reflect the characteristics of other linguistic and cultural environments, making it difficult to apply the developed models in broader contexts [29].
The vast majority of work in this niche focuses on languages with a developed digital infrastructure (primarily English). As a result, NLP-based risk monitoring systems often lose effectiveness when applied in multilingual environments or to languages with limited digital resources. Addressing this problem requires models that consider both semantic and cultural-linguistic characteristics of psychological expression. To address these limitations, this study proposes an interpretable NLP-based framework for psycho-emotional risk detection. It is based on a combination of transformer text processing models and explainable artificial intelligence (XAI) tools. Our approach combines the capabilities of contextual language modeling, integration of heterogeneous data types, and mechanisms for interpreting results (in particular, SHAP methods). This approach improves prediction accuracy while increasing model interpretability. In addition, the architecture was originally designed with the specifics of a multilingual environment in mind and includes data processing protocols that support user privacy protection.
Thus, the proposed approach aims to address key limitations of existing approaches, whether due to a lack of interpretability, limited data, or ethical difficulties in applying AI. The key problems identified during the analysis and the corresponding proposed solutions are summarized in Table 1.
Table 2 outlines the main characteristics and limitations of the approaches reviewed in this work.

3. Materials and Methods

3.1. System Model for Proposed Approach

The proposed system aims to identify linguistic patterns associated with psycho-emotional risk through contextual analysis of textual communication and timely data processing. By employing deep learning techniques, the framework extracts meaningful features from text and captures affective signals that may indicate psychological distress. Transformer-based language models, including the pretrained bert-base-uncased and roberta-base architectures available through the Hugging Face Transformers library (Hugging Face Inc., New York, NY, USA, version 4.44.0), as well as GPT-based language models, are used to enhance contextual language representation and improve the detection of subtle indicators of emotional instability expressed through diverse linguistic forms [26,27].
The central component of the system is a language processing module responsible for analyzing textual inputs, with particular attention to discourse potentially associated with psycho-emotional risk. By identifying linguistic markers related to sadness, emotional intensity, and semantically weighted expressions, the framework differentiates between ordinary communication and text that may reflect elevated psychological risk. Such differentiation enables the prioritization of cases that may require additional attention from specialists.
The system architecture is organized as a sequence of analytical stages. In the initial stage, raw text data undergoes preprocessing steps, including cleaning, tokenization, stop-word filtering, and normalization. Lexical resources and domain-specific dictionaries are subsequently used to identify expressions associated with psychological distress. Feature extraction techniques such as TF-IDF representations, contextual word embeddings, and emotion-related attributes are then used to capture both linguistic and psychological characteristics of the data [28].
For predictive analysis, the framework incorporates several deep learning architectures, including LSTM, BiLSTM, and transformer-based models [29,30]. Attention mechanisms are employed to highlight text segments that contribute most strongly to risk prediction [31]. To enhance interpretability, SHAP-based analysis is integrated into the system, allowing researchers and practitioners to examine how linguistic, emotional, and contextual features influence the estimated psycho-emotional risk score [32]. Based on the prediction results, individuals can be categorized into different risk levels—low, moderate, or high risk, and high-risk cases may trigger automated alerts for further evaluation.
The framework also includes an adaptive learning component that enables the model to be continuously updated using new data and feedback. This mechanism enables the system to adjust to emerging terminology and evolving patterns in online mental health discourse. In addition, the platform supports integration of heterogeneous data sources, including social media platforms such as Twitter, Reddit, and Facebook, as well as clinical records and digital counseling data [33,34]. The combination of multiple information sources contributes to more comprehensive monitoring and allows mental health professionals to focus on individuals who may require timely intervention [35].
Particular attention is given to privacy protection and responsible data handling. The framework incorporates data anonymization and secure processing mechanisms designed to safeguard sensitive information and comply with established ethical standards for health-related data analysis.
Despite the potential advantages of such systems, several challenges remain. Compliance with strict data protection regulations, including standards such as HIPAA and GDPR, is essential when processing sensitive psychological data [36,37]. Secure storage, encryption mechanisms, and controlled data access are therefore required to ensure responsible system deployment.
Another important issue concerns algorithmic bias. Predictive models trained on unbalanced datasets may produce unequal outcomes across different demographic groups. Addressing this problem requires careful evaluation of model fairness and the implementation of strategies that balance sensitivity and specificity in psycho-emotional risk detection [38]. Excessive false positives or false negatives may reduce the reliability of the system and undermine trust in automated risk assessment tools. For this reason, the system design includes the possibility of human expert review for cases flagged by the algorithm.
Future development of the framework will focus on improving model robustness, expanding multilingual capabilities, and increasing the efficiency of real-time data processing. Additional work will also explore the broader application of the system in digital mental health monitoring environments and clinical decision-support tools [39].
By addressing these challenges, the proposed framework may provide a reliable solution for assessing and preventing psycho-emotional risk. The system model of the proposed framework is illustrated in Figure 2.

3.2. Mathematical Model of Psycho-Emotional Risk Prediction

The psycho-emotional risk detection task considered in this study is formulated as a text-based classification problem. The framework estimates the probability that a given input instance corresponds to a specific psycho-emotional risk level while incorporating a complementary structured-indicator perspective [30].
Let the input observation be represented as a multimodal feature vector:
X = ( X t , X b , X p )
where X t represents textual features extracted from social media communication using transformer-based language models, X b denotes behavioral indicators such as user activity patterns and online interaction behavior, and X p represents aggregated behavioral/physiological indicators derived from structured public data, rather than raw biometric or sensor streams [40].
The objective of the proposed framework is to estimate the psycho-emotional risk score associated with an observation X . This prediction task can be represented as:
R = f X t , X b , X p
where R denotes the predicted psycho-emotional risk level and f ( ) represents the nonlinear mapping implemented by the proposed deep learning architecture [28].
To integrate heterogeneous sources of information, the final psycho-emotional risk score is computed as a weighted combination of modality-specific predictions [29]:
R = α R t + β R b + γ R p
where R t represents the textual risk score derived from NLP analysis, R b denotes the behavioral risk score derived from activity patterns, and R p represents the score derived from aggregated behavioral/physiological indicators available in structured form [41].
The coefficients α, β, and γ represent the relative importance of each modality and satisfy the constraint:
α + β + γ = 1
These parameters are automatically learned during model training.

3.2.1. Transformer-Based Textual Risk Estimation

Given a text sequence, the transformer encoder generates contextual embeddings:
T = w 1 , w 2 , , w n
H = T r a n s f o r m e r T
The textual risk score is obtained through a classification layer applied to the contextual representation:
R t = S o f t M a x W h H + b
where W h denotes the trainable weight matrix and b represents the bias term.
The SoftMax function converts model outputs into a probability distribution over risk categories:
P y H = e z y k = 1 K e z k
where K is the number of psycho-emotional risk classes.

3.2.2. Model Optimization

The model parameters are optimized using the cross-entropy loss function:
L = 1 N i = 1 N y i l o g y ^ i
where N denotes the number of training samples, y i represents the true label, y ^ i represents the predicted probability.
The model parameters are optimized using gradient-based optimization methods such as the Adam optimizer.
The computational cost is reduced through optimized transformer inference procedures, including batch processing and input sequence length reduction. Although direct energy consumption was not measured, the reduction in inference time and memory usage indicates improved computational efficiency of the proposed approach. These adjustments decrease the computational demand of the model without compromising classification performance. Such an approach enables practical deployment of the system in large-scale social media monitoring scenarios.

3.3. Broader Analytical Framework for Psycho-Emotional Risk Assessment

The approach combines several complementary analytical components, including natural language processing techniques, behavioral signal analysis, and the use of aggregated behavioral/physiological indicators when such structured attributes are available.
The integration of multiple information sources allows the framework to capture a broader range of signals associated with psychological distress [10,11].
Traditional approaches in this area typically focus on text-based analysis of online communication. While such methods provide valuable insights, they often overlook contextual behavioral patterns and additional signals that may accompany psychological distress [13,14]. The framework presented in this study addresses this limitation by simultaneously processing heterogeneous sources of information. These sources include textual communication data, behavioral interaction indicators derived from user activity, and aggregated behavioral/physiological attributes from structured datasets when such information is available.
The framework’s architecture is organized into four principal functional stages: data preprocessing, feature extraction, complementary structured-indicator analysis, and psycho-emotional risk classification. In the preprocessing stage, raw textual data undergo a sequence of normalization procedures, including tokenization, removal of non-informative words, and linguistic standardization. These operations help reduce noise in the input data and ensure that subsequent analytical stages operate on consistent and structured textual representations.
The feature extraction stage relies on transformer-based contextual language models. Models such as BERT and RoBERTa are used to generate contextual embeddings that capture semantic structure, emotional tone, and contextual dependencies within textual communication [14,17]. These representations allow the analytical system to detect subtle linguistic expressions that may indicate emotional distress or psychological instability.
Beyond textual information, the framework also incorporates behavioral indicators derived from user interaction patterns in digital environments. Examples include communication frequency, temporal activity patterns, and interaction dynamics within online platforms. When available, aggregated behavioral/physiological indicators, such as summary measures of heart rate variability or sleep duration, can provide additional context regarding emotional responses and psychological states [22].
Combining these heterogeneous information sources enables the construction of a more comprehensive representation of psycho-emotional risk. Compared with approaches that rely only on textual analysis, the proposed analytical approach may improve robustness when structured indicators are analyzed separately. The system operates in dynamic environments where data may originate from a variety of sources, including social media platforms, digital counseling systems, and health monitoring infrastructures [10,12].
The responsible use of sensitive psychological information is an important aspect of the framework design. The analytical pipeline incorporates privacy-preserving data processing mechanisms, including anonymization procedures applied prior to model analysis. In addition, the framework is designed to comply with widely accepted international data protection principles [7].
The overall structure of the multimodal psycho-emotional risk assessment framework is illustrated in Figure 3, which presents the main analytical components and the flow of data between processing stages.

3.3.1. Multimodal Risk Processing

The multimodal processing component is responsible for evaluating psycho-emotional indicators obtained from multiple information sources. Each data modality is analyzed independently to produce a modality-specific risk estimate reflecting the likelihood that the observed content corresponds to signals of psychological distress [10].
Textual information is processed using contextual language representations generated by transformer-based models. These representations capture semantic structure, emotional tone, and contextual linguistic cues present in written communication. Such contextual embeddings enable the identification of subtle expressions that may reflect underlying psycho-emotional states [14,17].
Behavioral indicators provide additional insight into user activity patterns within digital communication environments [42]. Variables such as posting frequency, engagement intensity, and temporal interaction dynamics may reveal behavioral changes that are often associated with psychological stress or emotional instability.
Where available, aggregated behavioral/physiological indicators may further contribute to the analytical process. Structured attributes, such as summary measures of heart rate variability or sleep duration, can provide complementary evidence related to stress-related or emotional patterns.
In this study, the datasets were analyzed separately rather than through sample-level multimodal fusion. Instead, the structured behavioral/physiological indicators were examined in a separate exploratory analytical setting complementary to the main text-based experiments. Accordingly, the role of these additional indicators should be understood as supportive and exploratory rather than as part of a fully synchronized multimodal fusion stage [10,13].
Algorithm 1 describes the multimodal risk evaluation procedure applied within the proposed framework.
Algorithm 1: Multimodal Mental Health Risk Assessment Process
Multimodal input (text and complementary structured behavioral/physiological indicators)
Initialization: {
L m : Risk assessment module;
r : Release decision;
S : Multimodal input (text and complementary structured behavioral/physiological indicators);
S d : Identified risk level;
D : Processing delay;
L r : Risk classification latency;
L a : Risk aggregation module;
R : Final risk prediction
}
  • Input:  { S }
  • Output:  { S d }
  • Set   L m   for   L
  • Examine   S L
  • Apply   L a S
  • If  S R h  then
  • Set   L e S (High-risk case)
  • Else If  S R l  then
  • Set   L e S (Low-risk case)
  • Else If  R l < S < R h  then
  • Continue monitoring, request additional data
  • Process   r S S d
  • End-if
  • Release Final Risk Classification

3.3.2. Multimodal Risk Fusion Strategy

To integrate heterogeneous information sources, the final psycho-emotional risk score is computed using a weighted fusion strategy. Similar multimodal fusion approaches have been widely applied in machine learning to improve prediction robustness and accuracy [10,13]. Each modality contributes a modality-specific prediction, which is aggregated to produce the final risk estimate.
The multimodal fusion model is defined as
R f = i = 1 n w i F i
where R f denotes the final psycho-emotional risk score, F i represents the modality-specific risk prediction, w i denotes the corresponding modality weight, n is the total number of modalities.
These weights are learned during the training process and reflect the relative importance of each modality in predicting psycho-emotional risk [26].
Table 3 summarizes the multimodal feature categories used in the proposed framework.
The multimodal fusion approach used in this study is mathematically represented as a weighted aggregation model, which is widely used for integrating heterogeneous feature spaces in multimodal learning frameworks [41]:
G a l l = G t e x t G b e h a v i o r G s t r u c t u r e d
where, G t e x t represents linguistic characteristics extracted from textual communication, G b e h a v i o r corresponds to behavioral interaction indicators describing user activity dynamics, and G s t r u c t u r e d denotes aggregated behavioral/physiological indicators obtained from structured public data rather than raw biometric observations [41].
In the present study, no sample-level fusion between Reddit text and the structured Psychological Crisis Dataset was performed. Therefore, the multimodal component should be interpreted as an exploratory analytical extension based on complementary structured indicators rather than as a fully aligned end-to-end fusion architecture with cross-attention or token-level multimodal interaction. The main predictive configuration remained the BERT-based text classification model, whereas the structured indicators were considered separately to broaden the analytical perspective on psycho-emotional risk.
In the implemented experiments reported in this study, the main predictive model remained a transformer-based text classifier. The proposed framework was examined conceptually and through a separate exploratory analysis of complementary structured indicators, rather than through a jointly trained sample-level fusion architecture. The overall analytical sequence relevant to feature extraction and risk evaluation is illustrated conceptually in Figure 4.
Conceptually, the broader analytical framework consists of contextual text representation, complementary structured-indicator analysis, and downstream risk estimation. However, in the implemented experiments reported in this manuscript, the main predictive model remained a fine-tuned BERT-based text classifier, while the structured behavioral/physiological indicators were examined in a separate exploratory setting rather than through a jointly trained sample-level fusion architecture.
During the training stage, Bayesian hyperparameter optimization is employed to improve model generalization and stability when working with heterogeneous data [26]. The structure of the training pipeline and the interaction between the principal components of the hybrid multimodal model are depicted in Figure 5.

3.3.3. Context-Aware Psycho-Emotional Risk Classification Model

The psycho-emotional risk assessment model processes multimodal feature vectors using a deep neural network, a standard approach for complex classification tasks in machine learning [17]. The neuron activation function at the level i is formulated as:
y i = S i g m o i d x i = 1 1 + e x i
where x i represents the input activation from the previous layer, y i is the output of the activation function.
Such layered neural representations enable modeling of nonlinear relationships between multimodal features [26].
Each neuron’s weighted sum is computed using:
z i = b i + j = 1 n w i j y j
where z i is the weighted input of neuron i , b i is the bias term, w i j is the weight between neuron j and neuron i , and y j is the activation from the previous layer.
To classify individuals into different psycho-emotional risk levels, a SoftMax output layer is used to convert raw network scores into probability distributions [28]:
P i = e x p ( z i ) k = 1 K e x p ( z k )
where P i denotes the probability of class i , z i is the input to the SoftMax function, and K is the number of classes.
To optimize model accuracy, the cross-entropy loss function is applied to minimize classification errors [28]:
L = i = 1 K y i l o g ( P i )
where y i is the true label and P i is the predicted probability for class i .
The total trainable parameters in the SoftMax layer are defined as:
Ψ = γ ^ V u + 1 + H l 1 γ ^ + 1 γ ^ + γ ^ + 1 Z
where V u is the number of input features, H l represents the number of hidden layers, γ ^ denotes the number of units per hidden layer, Z is the number of risk classes.
For the final implemented configuration, the proposed model is based on a fine-tuned BERT encoder followed by a lightweight classification layer for psycho-emotional risk prediction. The previously stated hidden-layer size of 5120 units was removed because it could be misread as the exact architecture of the final implemented model and could overstate model capacity relative to the dataset size. Given the moderate dataset sizes used in this study, model capacity was conservatively estimated, and the final model was selected based on validation performance to reduce the risk of overfitting.
To predict psycho-emotional risk based on temporal sequences, the posterior probability function is defined as [26]:
L ( θ ) = t = 1 T l o g P ( L t y t ; θ )
where L ( θ ) is the log-likelihood function, L t is the psycho-emotional risk label at time t , y t is the observed input, and θ represents model parameters.
Definition 1.
The maximum likelihood estimation (MLE) approach is employed to ensure robust psycho-emotional risk classification [26]. The likelihood function for sequential psycho-emotional risk prediction is defined as:
L = t = 1 T l o g P ( x t x < t ; θ )
where x t is the feature vector at time t, and x < t represents all previous observations.

3.4. Datasets and Experimental Setup

An experimental evaluation of the proposed system was conducted on two complementary datasets reflecting different aspects of psycho-emotional state—both through text and behavioral cues. This choice allows for an integrated approach that considers not only linguistic patterns but also behavioral characteristics, which may play an important role in psycho-emotional risk assessment.
Two open datasets were used in the study. The first is the Psychological Crisis Dataset, available on the Kaggle platform (Google LLC, Mountain View, CA, USA) (https://www.kaggle.com/datasets/programmer3/psychological-crisis-risk-dataset, accessed on 14 February 2026). It contains approximately 5800 observations, described by 20 features. These include aggregated behavioral/physiological characteristics, for example summary measures related to heart rate variability, sleep duration, and social media activity. Aggregated indicators, such as stress, anxiety, and depression levels, are also included. Overall, this dataset provides a more structured view of psycho-emotional condition.
The second dataset is the Reddit Mental Health Dataset (Google LLC, Mountain View, CA, USA) (https://www.kaggle.com/datasets/neelghoshal/reddit-mental-health-data, accessed on 14 February 2026). Unlike the first, it is text-based and contains approximately 5957 short messages from Reddit communities. Each message is associated with a dataset-provided label indicating the presence or absence of signs of psycho-emotional risk. These labels were obtained from the public repository used in this study and were not assigned by our research team. In addition, they should not be interpreted as clinician-validated diagnoses. The texts are generally brief and reflect the style of real online communication. Both datasets are open source and have already been used in research, facilitating the reproducibility of results. Furthermore, the data are anonymized, so their use complies with privacy regulations.
It should be noted that the two datasets were not merged at the individual-sample level and were not used as a jointly aligned multimodal corpus. The Reddit Mental Health Dataset was used for the main text-based classification experiments, whereas the Psychological Crisis Dataset was used separately as a structured dataset containing aggregated behavioral/physiological indicators. Therefore, the present study should be understood as combining complementary experimental settings rather than as a fully synchronized end-to-end multimodal framework.
Before training the model, the data underwent standard preprocessing. For text, this included tokenization, stop word removal, punctuation removal, and normalization. Behavioral and numerical features were further scaled using min-max normalization to bring the values to a common range [43].
To conduct the experiments, the datasets were divided into training, validation, and test subsets. Seventy percent of the data was allocated to training, while 15% was used for validation and 15% for testing. Stratification was applied during the partitioning process to preserve the original class distribution and reduce evaluation bias. The validation subset was used for model selection during training, whereas the final reported performance was obtained on the held-out test set. The experiments were carried out in Python 3.10 using PyTorch 2.1.0 library (Meta Platforms, Menlo Park, CA, USA) on a standard computing configuration (CPU/GPU). Additional software components used in the implementation included HuggingFace Transformers 4.40.2, NumPy 1.26.4, Pandas 2.2.2, Scikit-learn 1.4.2, and SHAP 0.44.1, as described in Section 3.4.5. The datasets used in the experimental evaluation are summarized in Table 4.
Both datasets are publicly available and widely used in studies of psychological risk detection and mental health analysis.

3.4.1. Dataset Limitations

Although the datasets used for psycho-emotional risk analysis are appropriate, several limitations should be acknowledged. First, they may contain biases related to demographic, cultural, or linguistic factors because data are sourced from specific online platforms and user groups. This can affect how well the model applies to broader populations. Second, the provenance and quality of the labels in publicly available datasets may introduce additional uncertainty, especially when labeling complex and context-dependent psycho-emotional states. In the case of the Reddit dataset used here, the labels were obtained from a public repository and were not clinically validated by our team. As a result, some samples may not fully reflect users’ actual psychological condition, which should be taken into account when interpreting the findings. Lastly, since the datasets are primarily text-based, they are limited in capturing multimodal indicators of psycho-emotional states, such as behavioral or physiological signals. These issues highlight the importance of developing more diverse and representative datasets in future research.
In addition, the datasets were not aligned at the individual-sample level, which limits the degree of multimodal integration achieved in the present study and should be taken into account when interpreting the results.

3.4.2. Baseline Models

To assess the effectiveness of the proposed framework, several baseline models were selected, covering both traditional machine learning and deep learning approaches commonly used in psycho-emotional risk detection.
The classical machine learning baselines included Logistic Regression (LR), Support Vector Machine (SVM), Random Forest (RF), Multinomial Naïve Bayes (MNB), and a Stochastic Gradient Descent classifier (SGD). These models were used as reference methods for identifying linguistic patterns associated with psycho-emotional risk and for comparing linear, probabilistic, margin-based, and ensemble learning behavior within the same experimental setting. In addition, deep learning models such as Long Short-Term Memory (LSTM) and Bidirectional LSTM (BiLSTM) were included to compare the proposed framework against sequential neural architectures that capture contextual dependencies in text. Transformer-based models, including BERT and RoBERTa, were also considered strong baselines due to their ability to model semantic context and long-range dependencies in recent NLP-based mental health studies.
To provide a stronger modern transformer baseline, Longformer was also included for its suitability for handling longer contextual sequences and its relevance to recent NLP research beyond conventional BERT-style baselines.
All baseline models were trained and evaluated under the same preprocessing pipeline, data splits, and evaluation metrics to ensure a fair and consistent comparison.

3.4.3. Dataset Selection Criteria

The datasets used in this study were selected according to several criteria to ensure the reliability and validity of the experimental evaluation.
First, the datasets needed to include textual data reflecting emotional distress expressed on social media or digital communication platforms. Such data enables the identification of linguistic indicators associated with psycho-emotional risks.
Second, the selected datasets needed to originate from publicly available and widely used research repositories. Using open datasets improves reproducibility and allows comparison with previous studies in natural language processing and mental health analytics.
Third, the datasets were required to contain annotated samples that distinguish between different levels of psychological distress or emotional instability. The availability of labeled data enables supervised machine learning approaches and facilitates the evaluation of classification performance.
Finally, ethical considerations were taken into account when selecting the datasets. All datasets used in this study are anonymized and publicly available, ensuring compliance with privacy protection standards and responsible AI research practices.

3.4.4. Dataset Statistics

To provide a clearer understanding of the dataset characteristics, several statistical properties of the collected textual data were analyzed. These statistics include dataset size, class distribution, average text length, and vocabulary diversity. Such information is important for evaluating the reliability and generalization capability of machine learning models.
The social media dataset used in this study contains 5957 textual samples, while the psychological crisis dataset includes 5800 structured behavioral samples. The textual dataset was used with the labels provided in the public repository, which distinguish between texts marked as higher-risk and lower/neutral with respect to psycho-emotional distress. These labels were not created by our team and should not be interpreted as clinician-validated diagnostic categories. The class distribution within the textual dataset is moderately imbalanced. Approximately 32% of the texts belong to the higher-risk label provided in the public dataset, while 68% belong to the lower/neutral label category. This distribution is reported here as a property of the dataset labels rather than as a clinically validated prevalence estimate. This distribution reflects realistic social media conditions, where high-risk expressions occur less frequently than neutral communication.
The average length of social media messages in the dataset is 21 tokens per text, which is typical for short-form online communication platforms such as Twitter (X Corp., Bastrop, TX, USA) or Reddit (Reddit Inc., San Francisco, CA, USA). After preprocessing procedures including tokenization, stopword removal, and normalization, the vocabulary size of the dataset consists of approximately 12,000 unique tokens.
Table 5 summarizes the key statistical characteristics of the textual dataset used in the experiments.
These statistical characteristics indicate that the dataset represents realistic social media communication patterns and provides sufficient linguistic variability for training transformer-based models.

3.4.5. Experimental Setup

All experiments were implemented in Python 3.10 using PyTorch 2.1.0 together with HuggingFace Transformers 4.40.2 for loading and fine-tuning pretrained transformer models. Data preprocessing and dataset management were performed using NumPy 1.26.4, Pandas 2.2.2, Scikit-learn 1.4.2, and SHAP 0.44.1.
The experiments were conducted on a workstation equipped with an NVIDIA RTX 3090 GPU (NVIDIA Corporation, Santa Clara, CA, USA) with 24 GB of VRAM, which significantly accelerated the training and inference processes of transformer-based models.
The same hardware configuration was also used for the empirical comparison of inference latency and GPU memory usage reported in the computational efficiency analysis.
For text processing tasks, the BERT WordPiece tokenizer was applied to convert textual inputs into numerical token representations. The maximum sequence length was set to 256 tokens.
The BERT model was fine-tuned using the AdamW optimizer with a learning rate of 2 × 10−5 and a batch size of 16 for five training epochs. The training, validation, and test splits were used consistently throughout the experiments, with the validation set used for model selection. No undocumented checkpoint from the final epoch was used by default; instead, the final reported model corresponds to the checkpoint with the best validation performance during training. Thus, the model was selected according to validation results rather than simply selecting the last epoch.
SHAP was used in this study as a post hoc interpretability method and not as a feature selection procedure applied before data splitting. The train/validation/test split was performed first, and SHAP explanations were generated only after model training and model selection had been completed. For the fine-tuned BERT classifier in the text-based experimental setting, SHAP explanations were computed using the PartitionExplainer method implemented in the SHAP library (version 0.44.1) together with a tokenizer-based text masker. Because this explanation setup defines perturbations directly through the text masker, no separate tabular background sample matrix was used. Token-level SHAP attributions were aggregated from WordPiece subword units to the word level by summing contiguous subword contributions for qualitative interpretation and case-based analysis. In the implementation reported here, explanations were generated for held-out test texts after model selection. SHAP was used exclusively to explain model behavior and was not used for feature selection, token filtering, sequence reduction, or any preprocessing step prior to model evaluation.
Reproducibility Statement
To enhance the reproducibility of the experimental results, all datasets utilized in this study are publicly available via the sources outlined in Section 3.4. The framework was developed using Python 3.10, with the main software environment including PyTorch 2.1.0, HuggingFace Transformers 4.40.2, NumPy 1.26.4, Pandas 2.2.2, Scikit-learn 1.4.2, and SHAP 0.44.1. Upon acceptance of the manuscript, the source code, preprocessing procedures, model configurations, and evaluation scripts will be publicly shared in a GitHub repository (GitHub Inc., San Francisco, CA, USA) to promote transparency and reproducibility.

3.4.6. Evaluation Parameters

To assess the effectiveness of the proposed framework for psycho-emotional risk detection, several quantitative evaluation metrics were employed. These metrics provide an objective assessment of model performance, including recognition accuracy, classification reliability, and predictive capability [44].
For modules involving speech recognition and transcription accuracy, the Word Error Rate (WER) was used as a standard metric. WER measures the difference between the reference transcription and the system-generated transcription and is defined as follows:
The Word Error Rate (WER) metric evaluates speech-to-text transcription accuracy:
W E R = S + D + I N
where S represents the number of substitutions, D denotes deletions, I corresponds to insertions, and N is the total number of words in the reference transcription.
Character Error Rate (CER) evaluates the accuracy of text-based processing:
C E R = S + D + I N c h a r
where N c h a r denotes the number of characters in the reference sequence.
Accuracy (A) measures correct classification performance:
A = T P + T N T P + T N + F P + F N
where T P denotes true positives, T N represents true negatives, F P corresponds to false positives, and F N indicates false negatives.
Precision, Recall and F1-score were also used to evaluate classification performance.
P r e c i s i o n = T P T P + F P
Recall measures the proportion of actual positive cases that were correctly identified:
R e c a l l = T P T P + F N
The F1-score represents the harmonic mean of precision and recall and is defined as:
F 1 = 2 P r e c i s i o n R e c a l l P r e c i s i o n + R e c a l l
To further evaluate the model’s discriminative ability, the Area Under the Receiver Operating Characteristic Curve (ROC-AUC) was calculated. This metric measures the ability of the classifier to distinguish between high- and low-risk psycho-emotional states across different classification thresholds.
The proposed Multimodal Psycho-Emotional Risk Assessment System (MPRAS) integrates probabilistic modeling and attention-based feature weighting to estimate psycho-emotional risk levels from heterogeneous data sources.
To optimize classification performance, the model employs a likelihood-based loss function defined as:
L θ = i = 1 N y i l o g y ^ i
where y i denotes the true class label, y ^ i represents the predicted probability of the corresponding class, N is the number of training samples, and θ denotes the model parameters.
This formulation corresponds to the cross-entropy loss function commonly used in neural network-based classification tasks. The loss function enables the model to iteratively adjust its parameters in order to minimize prediction error and improve classification accuracy. In the proposed architecture, contextual linguistic features extracted using transformer-based models are combined with attention-based weighting mechanisms to identify patterns associated with psycho-emotional risk. The probabilistic formulation allows the system to dynamically update risk predictions based on incoming data and contextual signals. The integration of explainable AI mechanisms further improves model transparency by enabling the interpretation of key linguistic indicators contributing to psycho-emotional risk predictions.

4. Results

4.1. Subsection

The experiments were conducted in two complementary settings. The Reddit Mental Health Dataset was used for the main text-based NLP classification task, while the Psychological Crisis Dataset was used separately to examine the possible contribution of structured aggregated behavioral/physiological indicators. No sample-level fusion between the two datasets was performed. To explore linguistic patterns associated with psycho-emotional risk, an exploratory analysis of textual data from the social media dataset was conducted. The most frequent lexical units were extracted from the textual corpus after applying standard preprocessing procedures, including tokenization, stop-word removal, and text normalization.
To visualize dominant linguistic patterns, the WordCloud technique was applied to high- and low-risk text samples separately. This visualization highlights the most frequently occurring words in the dataset and allows intuitive identification of lexical indicators associated with different psycho-emotional states.
The resulting visualization is presented in (Figure 6a,b), which illustrates the contrast between lexical patterns observed in high-risk psycho-emotional texts and those present in low-risk or neutral textual communication. In high-risk text samples, the most frequent terms tend to reflect emotional distress, negative affect, and expressions of psychological exhaustion. Such linguistic indicators may include words related to sadness, frustration, loneliness, and emotional pain.
In contrast, low-risk text samples typically contain vocabulary associated with positive emotions, social interactions, and everyday activities. These patterns often include expressions related to happiness, relationships, work, and personal development.
The observed differences in lexical distributions confirm that natural language processing techniques can capture meaningful linguistic signals related to psycho-emotional states. These findings support the effectiveness of transformer-based models for detecting psycho-emotional risk patterns in textual communication.

4.2. Classifiers Performance Analysis

Following the n-gram frequency analysis, the effectiveness of several machine learning (ML) and deep learning (DL) classifiers was evaluated for detecting psycho-emotional risk patterns in textual data. The performance of these models was assessed using five widely used evaluation metrics: accuracy, precision, recall, F1-score, and AUC (Area Under the Curve). The comparative performance of the evaluated classifiers is presented and discussed in the following subsections, where both machine learning and deep learning approaches are compared in detail.
The strong performance of transformer-based models can be attributed to their ability to capture contextual semantic relationships and long-range dependencies in textual data.

4.3. Ablation Study and Comparative Analysis

To better distinguish the role of the final proposed model from additional exploratory settings, an ablation-oriented and comparative analysis was conducted. The main proposed configuration in this study is the BERT-based text classification model with SHAP-based interpretability. Alongside this model, two additional settings were examined: a text-only BERT configuration without the interpretability component, and an exploratory extended setting that included complementary structured behavioral indicators from a separate public dataset. The purpose of this analysis is not only to compare raw predictive performance, but also to clarify the role of interpretability and the limited role of the exploratory structured-indicator extension in the overall study design.
The results of the comparative analysis of model configurations are summarized in Table 6.
The comparative analysis confirms that transformer-based representations substantially improve classification performance compared with classical machine learning approaches. The exploratory setting based on complementary structured behavioral indicators showed a modest increase in raw predictive accuracy; however, it was not used as the primary final model, because it represents an auxiliary extension rather than the main text-based configuration emphasized in the manuscript. The main proposed model remains the BERT-based text classifier with SHAP-based interpretability, achieving 96.3% accuracy while also providing the level of transparency required for responsible analysis in a sensitive domain. In this context, SHAP is not presented as a mechanism for maximizing raw accuracy, but as an interpretability component of the final proposed framework.

4.4. Comparison with Previous Studies

To understand how the proposed approach compares with existing work, the obtained results were compared with a number of recent studies that also used machine and deep learning methods to identify signs of psycho-emotional risk in online texts.
To place the present results in a broader context, several previous studies are summarized in Table 7. However, these works were conducted on different datasets and under different annotation schemes, preprocessing pipelines, and evaluation protocols. For this reason, the reported accuracy values should not be interpreted as directly comparable benchmarks.
A more methodologically appropriate comparison is the within-study evaluation reported later in the Results section, where conventional baselines and additional transformer-based models were trained and evaluated under the corresponding comparative setup used in this study. In this setting, the proposed BERT + SHAP configuration achieved an accuracy of 96.3%, outperforming RoBERTa (95.8%), BiLSTM (93.6%), LSTM (93.5%), Random Forest (91.2%), Support Vector Machine (91.0%), Stochastic Gradient Descent (90.5%), Logistic Regression (90.2%), and Multinomial Naïve Bayes (84.6%). These within-study results provide a more reliable basis for interpreting the relative performance of the proposed approach.
Thus, the prior studies listed in Table 7 are retained only for general contextual reference, whereas the main performance interpretation in this work is based on the direct comparison of models evaluated under the same experimental conditions.
The studies listed in Table 7 help position the present work within the broader literature. However, because they rely on different corpora and experimental protocols, the more appropriate basis for performance interpretation in this study remains the within-study baseline comparison reported in the Results section.

4.5. Computational Efficiency Analysis

In addition to predictive accuracy, computational efficiency is an important practical consideration for large-scale psycho-emotional risk detection systems operating on social media streams. In the present study, efficiency was evaluated empirically by measuring inference time and GPU memory usage under the same hardware configuration. Because FLOPs were not directly measured in our implementation, the efficiency claim is discussed in terms of observed latency and memory footprint rather than theoretical operation counts. This makes the efficiency analysis more transparent and consistent with the actual experimental setup. Table 8 presents a comparison of computational efficiency among the classification models used in this study.
The proposed approach achieves competitive inference speed while maintaining lower computational overhead than standard transformer configurations. The improvement is achieved through optimized transformer inference and lightweight preprocessing procedures, enabling scalable deployment for real-time psycho-emotional risk monitoring in large-scale digital communication environments.
To further illustrate the empirical efficiency results summarized in Table 8, Figure 7 compares inference time and GPU memory usage across the evaluated models under the same hardware configuration.
Although direct energy consumption was not explicitly measured, lower computational overhead typically correlates with decreased energy use in real-world deployment scenarios.

4.6. Performance Comparison of ML and DL Models

The experimental results demonstrate that deep learning models significantly outperform traditional machine learning methods in detecting psycho-emotional risk signals in textual data.
Among the evaluated final comparison models, the proposed BERT + SHAP configuration achieved the strongest overall performance, reaching an accuracy of 96.3%, with precision, recall, and F1-score values of 0.96, and an AUC score of 0.98. The RoBERTa model also demonstrated strong performance, achieving 95.8% accuracy, confirming the effectiveness of transformer-based architectures in capturing contextual semantic relationships in natural language. Longformer was also evaluated as an additional recent transformer-based baseline. Under the additional transformer-baseline evaluation setting used in this revision, it achieved an accuracy of 80.64%, with precision, recall, F1-score, and AUC values of 0.808, 0.806, 0.807, and 0.956, respectively. Although its performance was lower than that of the proposed BERT + SHAP configuration and RoBERTa, it provides a more up-to-date transformer-based reference point for the comparative evaluation.
Other deep learning models, such as BiLSTM and LSTM, achieved accuracies of 93.6% and 93.5%, respectively. Although their performance is slightly lower than transformer-based models, they still outperform most traditional machine learning approaches.
Among the classical machine learning baselines, Random Forest (RF) showed the best performance, achieving an accuracy of 91.2% and an F1-score of 0.91. Other baseline models, including Support Vector Machine (SVM), Stochastic Gradient Descent (SGD), and Logistic Regression (LR), achieved accuracies ranging from 90.2% to 91.0%.
In contrast, Multinomial Naïve Bayes (MNB) demonstrated the lowest performance with an accuracy of 84.6%, indicating its limitations in capturing contextual dependencies within textual data. The detailed comparison of model performance is presented in Table 9.
In addition to overall performance evaluation, the dataset’s class distribution the dataset was analyzed to assess the potential impact of class imbalance on model performance. The dataset was examined to ensure that both high-risk and low-risk psycho-emotional text samples were sufficiently represented. To mitigate possible bias in the classification process, stratified sampling was applied during the dataset splitting stage. This approach ensures that the proportion of samples from each class remains consistent across the training, validation, and testing subsets.
To ensure robustness and reliability of the obtained results, 5-fold cross-validation was additionally performed during model evaluation. In this procedure, the dataset was divided into five equal subsets, where four subsets were used for training and one subset was used for validation. The process was repeated five times, with each subset used once as the validation set. The final performance metrics reported in Table 9 represent the average results obtained across all folds, thereby reducing the risk of overfitting and improving the model’s generalization capability.
To further validate the reliability of the obtained results, a statistical significance test was performed to compare the performance of the evaluated models. In particular, a paired t-test was applied to determine whether the performance improvement of transformer-based models over traditional machine learning approaches was statistically significant. The analysis confirmed that the performance improvements achieved by the BERT model were statistically significant compared with baseline machine learning models such as Random Forest and Support Vector Classifier. The obtained p-value was below 0.05, indicating that the observed performance differences are unlikely to be caused by random variation.
These results provide additional evidence that transformer-based architectures are more effective for detecting psycho-emotional risk patterns in textual data.
To further illustrate the discriminative behavior of the models, precision–recall and ROC curves for the selected classifiers are presented in Figure 8. These curves provide a more detailed view of classification performance beyond the aggregate metric values reported in Table 9.
To provide a clearer visual summary of the comparative results, Figure 9 presents the performance profiles of the evaluated machine learning and deep learning models across the main classification metrics. As shown in the figure, transformer-based architectures achieve the strongest overall results, with BERT and RoBERTa outperforming both sequential neural models and conventional machine learning baselines. In contrast, Multinomial Naïve Bayes demonstrates the lowest performance across the reported metrics, which is consistent with the values summarized in Table 9.
To complement the metric-based comparison shown in Figure 9, confusion matrices were further analyzed for selected models. These matrices provide a more detailed view of prediction errors by illustrating the distribution of true positives, true negatives, false positives, and false negatives.
The confusion matrix for the BERT model, shown in Figure 10, demonstrates superior classification performance. The model achieved a true positive rate of 95.7%, while maintaining a relatively low false negative rate of 4.3% and a false positive rate of 5.8%. These results confirm the effectiveness of transformer-based architectures in identifying contextual patterns associated with psycho-emotional risk.
Overall, the experimental results indicate that transformer-based models such as BERT and RoBERTa outperform traditional machine learning approaches, as they are better able to capture semantic relationships and contextual dependencies within textual data. Future research should focus on reducing false positive predictions while maintaining high detection accuracy, thereby improving the reliability of AI-based psycho-emotional risk detection systems.
Although the BERT-based model demonstrates strong classification performance, a detailed analysis of prediction errors was conducted to better understand the limitations of the proposed approach. In particular, false positive (FP) and false negative (FN) predictions were examined in order to identify potential sources of misclassification.
The distribution of classification errors across different models is illustrated in Figure 11, which presents a comparative analysis of false-positive and false-negative predictions. Error analysis is important for improving the reliability of psycho-emotional risk detection systems.
Case-Based SHAP Error Analysis.
To better understand model failures, selected false positive and false negative patterns were further interpreted in light of local SHAP reasoning. This analysis complements the global feature-importance view by showing how the model may behave in specific ambiguous cases. In false positive settings, metaphorical, emotionally exaggerated, or topic-related wording may receive disproportionately high importance, even when the broader context is not indicative of severe psycho-emotional risk. In false negative settings, indirect, brief, or weakly contextualized expressions of distress may produce lower feature salience and therefore remain underdetected. These observations suggest that ambiguity, sarcasm, figurative language, and implicit expressions of distress remain important sources of classification error.
To make the error analysis more concrete, Table 10 summarizes representative false positive and false negative patterns discussed in this study together with their qualitative SHAP-oriented interpretation. The aim is not to provide exhaustive token-level attribution for every error, but to demonstrate how local explanation logic helps clarify common sources of misclassification.
False Positive Errors.
False positive errors occur when low-risk text samples are incorrectly classified as high-risk psycho-emotional content. Such misclassifications may arise due to several linguistic and contextual factors.
First, ambiguous language may lead to incorrect interpretation by the model. For example, phrases such as “I am tired of everything” may express temporary emotional frustration rather than actual psychological distress.
Second, sarcasm and figurative expressions may be misinterpreted by NLP models. Statements such as “This project is killing me” contain metaphorical language that does not necessarily indicate emotional risk.
Third, general discussions about mental health topics may also trigger false alarms. Messages discussing anxiety, stress, or therapy in an informational context may be mistakenly classified as high-risk content.
False Negative Errors.
False negative errors occur when text samples that contain indicators of psycho-emotional distress are incorrectly classified as low-risk messages.
Such errors may occur when emotional signals are expressed indirectly or implicitly, making them difficult for the model to detect. For instance, short statements such as “It’s over” or “I just want to disappear” may lack sufficient contextual information for accurate interpretation.
Another possible source of false negatives is linguistic diversity and cultural variation in the expression of emotional distress. If certain phrases or linguistic patterns are underrepresented in the training dataset, the model may struggle to recognize them during prediction.
Future Improvements.
To reduce classification errors, future work should focus on improving contextual understanding by integrating multimodal data, including behavioral and physiological indicators. In addition, explainable AI techniques such as SHAP analysis and attention visualization may help interpret model decisions and improve transparency.
Such improvements may contribute to the development of more reliable and ethically responsible psycho-emotional risk detection systems.
The efficiency of the proposed framework was evaluated by measuring inference time and GPU memory usage. The framework demonstrated faster inference and lower memory consumption than baseline models, highlighting better computational efficiency. While direct energy consumption was not measured, decreased computational overhead usually correlates with lower energy consumption in large-scale AI systems.

5. Discussion

Recent advances in artificial intelligence and natural language processing have opened new opportunities for identifying psycho-emotional risk signals in digital communication environments. The results of this study demonstrate the effectiveness of transformer-based models for detecting linguistic indicators of psychological distress in textual data. In particular, the strong performance of the BERT-based model highlights the value of contextual language representations for capturing subtle semantic patterns associated with emotional instability.
The integration of multimodal data sources further improves the robustness of the proposed framework. By combining text-based analysis with structured behavioral indicators from a separate public dataset, the study explores additional perspectives on psycho-emotional risk. However, this multimodal aspect should be interpreted cautiously, because the datasets were analyzed separately and no raw biometric data were used. This analytical approach may be useful when analyzing complex mental health phenomena, where linguistic expressions alone may not fully reflect the underlying psychological state of an individual.
Another important contribution of this work lies in the incorporation of explainable artificial intelligence techniques. Interpretability mechanisms such as SHAP-based feature attribution allow researchers and practitioners to better understand how the model generates risk predictions. In sensitive domains such as mental health monitoring, model transparency is essential for building trust and supporting responsible decision-making.
Despite these promising results, several limitations remain that should be addressed in future research.
A. Limitations.
Data Availability.
A major challenge in AI-based mental health detection systems is the limited availability of high-quality annotated datasets. Most existing studies rely on publicly available social media datasets, crisis hotline transcripts, or clinical records [31]. However, these datasets often contain a relatively small number of labeled samples, which may restrict the generalization capability of machine learning models [33].
This limitation becomes particularly critical for low-resource languages, where annotated datasets related to mental health are scarce. In addition, real-world textual data frequently contain noise, sarcasm, and ambiguous linguistic expressions, which can complicate the accurate detection of psychological distress signals [35].
Annotation Bias.
The process of labeling mental health–related content presents another challenge. Some datasets rely on crowdsourced annotations, while others are labeled by clinical experts [37]. Although expert annotations generally provide higher reliability, they are difficult to scale due to the time and cost required for manual evaluation.
As a result, inconsistencies in labeling may introduce bias into the training process. Machine learning models trained on imperfect annotations may produce inaccurate predictions, increasing the risk of both false positives and false negatives [37].
Data Imbalance.
Mental health-related signals represent only a small fraction of the overall content generated on social media platforms. Consequently, datasets used for training NLP models are often highly imbalanced [36]. Although various sampling techniques have been proposed to mitigate this issue, artificially balanced datasets may not accurately reflect real-world data distributions [34].
Developing robust machine learning techniques that operate effectively under severe class imbalance remains an important research challenge.
Limited Psychological Context.
Although transformer-based models demonstrate strong performance in detecting linguistic risk indicators, they still rely primarily on statistical relationships between textual features and classification labels. Human psychological behavior, however, is influenced by complex social, cultural, and emotional factors.
As a result, NLP models may fail to capture deeper psychological mechanisms behind emotional distress, especially when signals are expressed indirectly or metaphorically [38].
B. Future Research Directions.
Future research should focus on several directions to improve the reliability and applicability of AI-driven psycho-emotional risk detection systems.
First, the development of larger and more diverse multilingual datasets would significantly improve model generalization across different linguistic and cultural contexts. Second, integrating additional modalities such as wearable sensor data, behavioral activity patterns, and physiological signals could enhance the accuracy of early risk detection.
Another promising direction involves the development of privacy-preserving machine learning techniques, including federated learning and secure multi-party computation. These approaches could enable collaborative model training while preserving the confidentiality of sensitive mental health data.
Finally, further work is needed to improve the interpretability of deep learning models used in mental health monitoring. Combining explainable AI techniques with domain knowledge from psychology and psychiatry may help create more reliable and ethically responsible AI systems for early detection of psycho-emotional risks.
Practically, the lower computational demands of the proposed framework enhance its suitability for real-time settings, where quick processing and efficient resource use are essential.

6. Conclusions

This study presented an explainable NLP-based framework for detecting psycho-emotional risk signals in digital communication environments. The main contribution of this study is the integration of transformer-based text modeling with SHAP-based interpretation, which improves model transparency and interpretability.
The experimental results showed that the BERT-based model achieved strong performance on the text classification task, with an accuracy of 96.3%, an F1-score of 0.96, and a ROC–AUC of 0.98. These results suggest that contextual language representations can effectively identify subtle indicators of emotional distress in online discourse.
Another important part of the proposed approach is the use of explainability mechanisms, especially SHAP-based interpretation. In research connected with mental health, this is particularly important, since high predictive performance alone is not enough if the model remains difficult to interpret. In this context, transparency is an essential component of responsible analytical use.
The study also explored the possible contribution of complementary structured behavioral indicators taken from a separate public dataset. At the same time, no raw physiological or biometric streams were used, and the datasets were not aligned at the individual-sample level. Because of this, the multimodal aspect of the present work should be viewed as exploratory rather than as a fully implemented multimodal fusion setting or a clinically validated evaluation.
Several limitations should also be noted. The study relies on publicly available datasets of limited size, which naturally affects the extent to which the results can be generalized. Future work should therefore focus on larger and more diverse datasets, stronger cross-domain validation, reducing possible bias in the training data, and testing the framework under more realistic conditions. It would also be reasonable to consider privacy-preserving learning strategies in future extensions of this work.
Overall, the findings indicate that explainable transformer-based NLP methods have clear potential for psycho-emotional risk detection in digital communication data. At the same time, further validation on larger, more diverse, expert-reviewed, and real-world datasets is still needed before practical or clinical deployment can be discussed with confidence.
C. Ethical Considerations.
Any practical deployment of proactive psycho-emotional risk detection systems requires careful ethical safeguards. First, although the datasets used in this study are publicly available and anonymized, real-world deployment would require strict compliance with data protection regulations, including GDPR- and HIPAA-aligned principles of data minimization, controlled access, and secure storage. Second, false-positive predictions may lead to inappropriate labeling of users, while false-negative predictions may fail to identify individuals who need support. For this reason, the framework should not be interpreted as a stand-alone diagnostic or decision-making system. Third, any applied use in real-world digital environments would require clear consent procedures, restricted access policies, and meaningful human oversight. In its present form, the proposed framework should be understood as a research-oriented analytical tool rather than a ready-to-deploy monitoring system.

Author Contributions

Conceptualization, O.B. and K.S.; methodology, D.A. and Y.B.; software, O.B. and A.T.; validation, L.D., Z.D. and S.K.; formal analysis, O.B., D.A. and K.S.; investigation, A.T., L.D. and Z.D.; resources, Y.B. and K.S.; data curation, D.A.; writing—original draft preparation, O.B., S.K.; writing—review and editing, D.A., Y.B. and K.S.; visualization, S.K., A.T. and Z.D.; supervision, K.S. All authors have read and agreed to the published version of the manuscript.

Funding

This research received no external funding.

Data Availability Statement

Publicly available datasets were analyzed in this study. The Psychological Crisis Dataset is available at Kaggle: https://www.kaggle.com/datasets/programmer3/psychological-crisis-risk-dataset (accessed on 14 February 2026). The Reddit Mental Health Dataset is available at Kaggle: https://www.kaggle.com/datasets/neelghoshal/reddit-mental-health-data (accessed on 14 February 2026).

Conflicts of Interest

The authors declare no conflict of interest.

Abbreviations

The following abbreviations are used in this manuscript:
AIArtificial Intelligence
AUCArea Under the Curve
BERTBidirectional Encoder Representations from Transformers
BiLSTMBidirectional Long Short-Term Memory
F1-scoreHarmonic mean of precision and recall
GPUGraphics Processing Unit
LRLogistic Regression
LSTMLong Short-Term Memory
MNBMultinomial Naïve Bayes
NLPNatural Language Processing
RFRandom Forest
ROCReceiver Operating Characteristic
SHAPSHapley Additive exPlanations
SVMSupport Vector Machine
XAIExplainable Artificial Intelligence

References

  1. Lasria, S.; Nfaouib, E.H.; El Haoussi, F. Suicide Ideation Detection on Social Networks: Short Literature Review. Procedia Comput. Sci. 2022, 215, 713–721. [Google Scholar] [CrossRef]
  2. Goela, R.; Digalwara, M. Suicidal Thought Detection using Max Voting Ensemble Technique. Procedia Comput. Sci. 2024, 235, 2587–2598. [Google Scholar] [CrossRef]
  3. Babenko, T.; Kolesnikova, K.; Bakhtiyarova, Y.; Yeskendirova, D.; Sansyzbay, K.; Sysoyev, A.; Kruchinin, O. Hybrid GNN–LSTM Architecture for Probabilistic IoT Botnet Detection with Calibrated Risk Assessment. Computers 2026, 15, 26. [Google Scholar] [CrossRef]
  4. Feroze, S.A.; Feroze, S.M.B.; Abbasi, U. Unveiling Distress: Harnessing NLP and Deep Learning to Identify Suicidal Signals in Tweets. Int. J. Technol. Innov. Manag. (IJTIM) 2024, 4, 20–31. [Google Scholar] [CrossRef]
  5. Ji, S. Towards Intention Understanding in Suicidal Risk Assessment with Natural Language Processing. In Findings of the Association for Computational Linguistics; Association for Computational Linguistics: Stroudsburg, PA, USA, 2022; pp. 4028–4038. [Google Scholar] [CrossRef]
  6. Skaik, R.; Inkpen, D. Suicide Ideation Estimators within Canadian Provinces Using Machine Learning Tools on Social Media Text. J. Adv. Inf. Technol. 2021, 12, 357–362. [Google Scholar] [CrossRef]
  7. D’Hotman, D.; Loh, E. AI enabled suicide prediction tools: A qualitative narrative review. BMJ Health Care Inform. 2020, 27, e100175. [Google Scholar] [CrossRef]
  8. Carson, N.J.; Mullin, B.; Sanchez, M.J.; Lu, F.; Yang, K.; Menezes, M.; Cook, B.L. Identification of suicidal behavior among psychiatrically hospitalized adolescents using natural language processing and machine learning of electronic health records. PLoS ONE 2019, 14, e0211116. [Google Scholar] [CrossRef]
  9. Grant, R.N.; Kucher, D.; León, A.M.; Gemmell, J.F.; Raicu, D.S.; Fodeh, S.J. Automatic extraction of informal topics from online suicidal ideation. BMC Bioinform. 2018, 19, 57–66. [Google Scholar] [CrossRef] [PubMed]
  10. Yeskuatov, E.; Chua, S.-L.; Foo, L.K. Leveraging Reddit for Suicidal Ideation Detection: A Review of Machine Learning and Natural Language Processing Techniques. Int. J. Environ. Res. Public Health 2022, 19, 10347. [Google Scholar] [CrossRef]
  11. Arowosegbe, A.; Oyelade, T. Application of Natural Language Processing (NLP) in Detecting and Preventing Suicide Ideation: A Systematic Review. Int. J. Environ. Res. Public Health 2023, 20, 1514. [Google Scholar] [CrossRef] [PubMed]
  12. Cliffe, C.; Cusick, M.; Vellupillai, S.; Shear, M.; Downs, J.; Epstein, S.; Pathak, J.; Dutta, R. A multisite comparison using electronic health records and natural language processing to identify the association between suicidality and hospital readmission amongst patients with eating disorders. Int. J. Eat. Disord. 2023, 56, 1581–1592. [Google Scholar] [CrossRef] [PubMed]
  13. Castillo-Sánchez, G.; Marques, G.; Dorronzoro, E.; Rivera-Romero, O.; Franco-Martín, M.; De la Torre-Díez, I. Suicide Risk Assessment Using Machine Learning and Social Networks: A Scoping Review. J. Med. Syst. 2020, 44, 205. [Google Scholar] [CrossRef] [PubMed]
  14. Levkovich, I.; Omar, M. Evaluating of BERT-based and Large Language Mod for Suicide Detection, Prevention, and Risk Assessment: A Systematic Review. J. Med. Syst. 2024, 48, 113. [Google Scholar] [CrossRef]
  15. Fernandes, A.C.; Dutta, R.; Velupillai, S.; Sanyal1, J.; Stewart, R.; Chandran, D. Identifying Suicide Ideation and Suicidal Attempts in a Psychiatric Clinical Research Database using Natural Language Processing. Sci. Rep. 2018, 8, 7426. [Google Scholar] [CrossRef]
  16. Bejan, C.A.; Ripperger, M.; Wilimitis, D.; Ahmed, R.; Kang, J.; Robinson, K.; Morley, T.J.; Ruderfer, D.M.; Walsh, C.G. Improving ascertainment of suicidal ideation and suicide attempt with natural language processing. Sci. Rep. 2022, 12, 15146. [Google Scholar] [CrossRef]
  17. Zhang, T.; Schoene, A.M.; Ji, S.; Ananiadou, S. Natural language processing applied to mental illness detection: A narrative review. npj Digit. Med. 2022, 5, 46. [Google Scholar] [CrossRef]
  18. Schoene, A.M.; Garverich, S.; Ibrahim, I.; Shah, S.; Irving, B.; Dacso, C.C. Automatically extracting social determinants of health for suicide: A narrative literature review. npj Ment. Health Res. 2024, 3, 51. [Google Scholar] [CrossRef]
  19. Aliaskarov, S.; Bekmurat, O.; Serbin, V.; Sansyzbay, K.; Bakhtiyarova, Y.; Andekin, E. Predicting Adolescent Suicide Risk in Smart Cities: An AI-Driven, Privacy-Preserving Architecture. HighTech Innov. J. 2025, 6, 1361–1389. [Google Scholar] [CrossRef]
  20. Vidal-Arenas, V.; Bravo, A.J.; Ortet-Walker, J.; Ortet, G.; Mezquita, L.; Ibáñez, M.I.; Cross-Cultural Addictions Study Team. Neuroticism, rumination, depression and suicidal ideation: A moderated serial mediation model across four countries. Int. J. Clin. Health Psychol. 2022, 22, 100325. [Google Scholar] [CrossRef]
  21. Ji, S.; Pan, S.; Li, X.; Cambria, E.; Long, G.; Huang, Z. Suicidal Ideation Detection: A Review of Machine Learning Methods and Applications. IEEE Trans. Comput. Soc. Syst. 2021, 8, 214–226. [Google Scholar] [CrossRef]
  22. Velupillai, S.; Epstein, S.; Bittar, A.; Stephenson, T.; Dutta, R.; Downs, J. Identifying Suicidal Adolescents from Mental Health Records Using Natural Language Processing. Stud. Health Technol. Inform. 2019, 264, 413–417. [Google Scholar] [CrossRef]
  23. Haque, R.; Islam, N.; Islam, M.; Ahsan, M.M. A Comparative Analysis on Suicidal Ideation Detection Using NLP, Machine, and Deep Learning. Technologies 2022, 10, 57. [Google Scholar] [CrossRef]
  24. Cohen, J.; Wright-Berryman, J.; Rohlfs, L.; Trocinski, D.; Daniel, L.; Klatt, T.W. Integration and Validation of a Natural Language Processing Machine Learning Suicide Risk Prediction Model Based on Open-Ended Interview Language in the Emergency Department. Front. Digit. Health 2022, 4, 818705. [Google Scholar] [CrossRef]
  25. Wulz, A.R.; Law, R.; Wang, J.; Wolkin, A.F. Leveraging data science to enhance suicide prevention research: A literature review. Inj. Prev. J. Int. Soc. Child. Adolesc. Inj. Prev. 2022, 28, 74–80. [Google Scholar] [CrossRef] [PubMed]
  26. Baltrušaitis, T.; Ahuja, C.; Morency, L.-P. Multimodal Machine Learning: A Survey and Taxonomy. IEEE Trans. Pattern Anal. Mach. Intell. 2019, 41, 423–443. [Google Scholar] [CrossRef] [PubMed]
  27. Aliaskarov, S.; Uskenbayeva, R.; Serbin, V.; Bekmurat, O.; Bazarbayeva, U.; Bakhtiyarova, Y.; Sansyzbay, K. Mathematical Approaches and Algorithms in Big Data Architecture and Hybrid System Efficiency. HighTech Innov. J. 2025, 6, 1013–1034. [Google Scholar] [CrossRef]
  28. Diniz, E.; Fontenele, J.E.; de Oliveira, A.C.; Bastos, V.H.; Teixeira, S.; Rabêlo, R.; Calçada, D.B.; dos Santos, R.; de Oliveira, A.K.; Teles, A.S. Boamente: A Natural Language Processing-Based Digital Phenotyping Tool for Smart Monitoring of Suicidal Ideation. Healthcare 2022, 10, 698. [Google Scholar] [CrossRef]
  29. Saduakassova, K.; Zhanuzakov, M.; Kassenova, G.; Serbin, V. Artificial Intelligence as a Tool to Prevent Autoaggressive Destructive Behavior Among Children and Adolescents: A Brief Overview. J. Clin. Med. Kaz. 2024, 21, 24–29. [Google Scholar] [CrossRef]
  30. Vance, L.A.; Way, L.; Kulkarni, D.; Palmer, E.O.C.; Ghosh, A.; Unruh, M.; Chan, K.M.Y.; Girdhari, A.; Sarkar, J. Natural language processing to identify suicidal ideation and anhedonia in major depressive disorder. BMC Med. Inform. Decis. Mak. 2025, 25, 20. [Google Scholar] [CrossRef]
  31. Broadbent, M.; Medina Grespan, M.; Axford, K.; Zhang, X.; Srikumar, V.; Kious, B.; Imel, Z. A machine learning approach to identifying suicide risk among text-based crisis counseling encounters. Front. Psychiatry 2023, 14, 1110527. [Google Scholar] [CrossRef]
  32. Cook, B.L.; Progovac, A.M.; Chen, P.; Mullin, B.; Hou, S.; Baca-Garcia, E. Novel Use of Natural Language Processing (NLP) to Predict Suicidal Ideation and Psychiatric Symptoms in a Text-Based Mental Health Intervention in Madrid. Comput. Math. Methods Med. 2016, 2016, 8708434. [Google Scholar] [CrossRef]
  33. Coppersmith, G.; Leary, R.; Crutchley, P.; Fine, A. Natural Language Processing of Social Media as Screening for Suicide Risk. Biomed. Inform. Insights 2018, 10, 1178222618792860. [Google Scholar] [CrossRef] [PubMed]
  34. Swaminathan, A.; López, I.; Mar, R.A.G.; Heist, T.; McClintock, T.; Caoili, K.; Grace, M.; Rubashkin, M.; Boggs, M.N.; Chen, J.H.; et al. Natural language processing system for rapid detection and intervention of mental health crisis chat messages. npj Digit. Med. 2023, 6, 213. [Google Scholar] [CrossRef] [PubMed]
  35. Pestian, J.; Nasrallah, H.; Matykiewicz, P.; Bennett, A.; Leenaars, A. Suicide Note Classification Using Natural Language Processing: A Content Analysis. Biomed. Inform. Insights 2010, 3, 19–28. [Google Scholar] [CrossRef]
  36. Cusick, M.; Velupillai, S.; Downs, J.; Campion, T.R., Jr.; Sholle, E.T.; Dutta, R.; Pathak, J. Portability of natural language processing methods to detect suicidality from clinical text in US and UK electronic health records. J. Affect. Disord. Rep. 2022, 10, 100430. [Google Scholar] [CrossRef] [PubMed]
  37. Sandoval, A.A.; Aguilar-Canto, F.; Jimenez, D.; Calvo, H. Suicide Tendency Content Detection with Natural Language Processing and LIME Explainer. Res. Comput. Sci. 2023, 152, 143–152. [Google Scholar]
  38. Grimland, M.; Benatov, J.; Yeshayahu, H.; Izmaylov, D.; Segal, A.; Gal, K.; Levi-Belz, Y. Predicting suicide risk in real-time crisis hotline chats integrating machine learning with psychological factors: Exploring the black box. Suicide Life-Threat. Behav. 2024, 54, 416–424. [Google Scholar] [CrossRef]
  39. Sansyzbay, K.M.; Bakhtiyarova, Y.A.; Iliev, T.; Patokin, G.S.; Tasbolatova, L.T.; Sagmedinov, D.B. Development of an Algorithm for a National Microprocessor-Based Centralization System with a Modular Architecture KZ-MPC-MA Featuring Advanced Intelligent Control Functions. IEEE Access 2024, 12, 193229–193240. [Google Scholar] [CrossRef]
  40. Sivagurunathan, S.; Kumar, D.S.; Madhavan, G.A.; Rahul, K. Suicidal content detection using nlp and machine learning technique in social platform. Int. J. Creat. Res. Thoughts 2023, 11, 221–226. [Google Scholar]
  41. Karthikeyan, P.; Ajay, I.; Magesh, R.; Saran, G. Suicidal Text Detection in Social Media. Int. J. Res. Anal. Rev. 2023, 10, 20–27. [Google Scholar]
  42. Devlin, J.; Chang, M.W.; Lee, K.; Toutanova, K. BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding. In Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long and Short Papers); Association for Computational Linguistics: Stroudsburg, PA, USA, 2019; pp. 4171–4186. [Google Scholar] [CrossRef]
  43. Liu, X.; Liu, X.; Sun, J.; Yu, N.X.; Sun, B.; Li, Q.; Zhu, T. Proactive Suicide Prevention Online (PSPO): Machine Identification and Crisis Management for Chinese Social Media Users With Suicidal Thoughts and Behaviors. J. Med. Internet Res. 2019, 21, e11705. [Google Scholar] [CrossRef] [PubMed]
  44. Sawhney, R.; Shah, R.R.; Bhatia, V.; Lin, C.T.; Aggarwal, S.; Prasad, M. Exploring the Impact of Evolutionary Computing based Feature Selection in Suicidal Ideation Detection. In Proceedings of the 2019 IEEE International Conference on Fuzzy Systems (FUZZ-IEEE), New Orleans, LA, USA, 23–26 June 2019. [Google Scholar] [CrossRef]
Figure 1. Conceptual architecture of the proposed NLP-based psycho-emotional risk detection framework.
Figure 1. Conceptual architecture of the proposed NLP-based psycho-emotional risk detection framework.
Computers 15 00327 g001
Figure 2. Conceptual workflow of the text-based psycho-emotional risk detection framework.
Figure 2. Conceptual workflow of the text-based psycho-emotional risk detection framework.
Computers 15 00327 g002
Figure 3. Conceptual analytical workflow combining text-based classification with complementary structured indicators.
Figure 3. Conceptual analytical workflow combining text-based classification with complementary structured indicators.
Computers 15 00327 g003
Figure 4. Conceptual pipeline of text-based risk detection and complementary structured-indicator analysis.
Figure 4. Conceptual pipeline of text-based risk detection and complementary structured-indicator analysis.
Computers 15 00327 g004
Figure 5. Conceptual training pipeline of the broader analytical framework.
Figure 5. Conceptual training pipeline of the broader analytical framework.
Computers 15 00327 g005
Figure 6. Word cloud comparison of representative lexical patterns in the high-risk and low-risk text groups: (a) high-risk samples; (b) low-risk samples. Larger words indicate higher relative frequency within the corresponding class. The visualization is intended for qualitative interpretation only and complements the quantitative results reported in the classification analysis.
Figure 6. Word cloud comparison of representative lexical patterns in the high-risk and low-risk text groups: (a) high-risk samples; (b) low-risk samples. Larger words indicate higher relative frequency within the corresponding class. The visualization is intended for qualitative interpretation only and complements the quantitative results reported in the classification analysis.
Computers 15 00327 g006
Figure 7. Visual comparison of inference time and GPU memory usage across the evaluated models under the same hardware configuration.
Figure 7. Visual comparison of inference time and GPU memory usage across the evaluated models under the same hardware configuration.
Computers 15 00327 g007
Figure 8. Performance curves for selected classifiers: (a) precision–recall curves for the BERT and Random Forest models; (b) ROC curves for the BERT and Random Forest models. In panel (b), the dashed diagonal line indicates the no-discrimination baseline corresponding to random classification.
Figure 8. Performance curves for selected classifiers: (a) precision–recall curves for the BERT and Random Forest models; (b) ROC curves for the BERT and Random Forest models. In panel (b), the dashed diagonal line indicates the no-discrimination baseline corresponding to random classification.
Computers 15 00327 g008
Figure 9. Comparative visualization of accuracy, precision, recall, and F1-score across the evaluated machine learning and deep learning models.
Figure 9. Comparative visualization of accuracy, precision, recall, and F1-score across the evaluated machine learning and deep learning models.
Computers 15 00327 g009
Figure 10. Confusion matrices of Random Forest and BERT classifiers illustrating prediction performance for high-risk and low-risk psycho-emotional text samples: (a) Confusion Matrix—Random Forest; (b) Confusion Matrix—BERT.
Figure 10. Confusion matrices of Random Forest and BERT classifiers illustrating prediction performance for high-risk and low-risk psycho-emotional text samples: (a) Confusion Matrix—Random Forest; (b) Confusion Matrix—BERT.
Computers 15 00327 g010
Figure 11. Distribution of false positive and false negative errors across models.
Figure 11. Distribution of false positive and false negative errors across models.
Computers 15 00327 g011
Table 1. The main limitations of existing approaches to identifying psycho-emotional risk and strategies for overcoming them within the proposed model.
Table 1. The main limitations of existing approaches to identifying psycho-emotional risk and strategies for overcoming them within the proposed model.
ApproachLimitationHow Our Work Addresses It
Classical ML (SVM, RF, LR)Limited contextual understanding; high dependence on manual feature engineeringUse of transformer-based embeddings (BERT, RoBERTa) for contextualized representations
Deep learning (BERT, RoBERTa)High accuracy but poor interpretability (black-box models)Integration of explainable AI methods (SHAP, attention mechanisms)
Text-only models (Twitter, Reddit)Data imbalance; ambiguity, sarcasm, and cultural biasExtension beyond text-only analysis through the use of complementary structured behavioral indicators; richer multimodal integration remains a direction for future work
Clinical datasets (EHR notes)Limited availability; privacy and annotation-related bias issuesPrivacy-preserving design (GDPR/HIPAA) and the potential use of federated learning
Multilingual research (low-resource languages)Underrepresented; poor cross-lingual transferMultilingual adaptability for low-resource settings
Table 2. Comparative analysis of existing NLP approaches for psycho-emotional risk detection.
Table 2. Comparative analysis of existing NLP approaches for psycho-emotional risk detection.
WorksApproaches/AlgorithmsFeatures & StrengthsDeficiencies & Vulnerabilities
Castillo-Sánchez et al. [13]Machine learning methods for risk assessment using social media dataDemonstrated the applicability of NLP techniques for detecting psycho-emotional risk from textual data and improving classification performanceSusceptible to bias in training data, which may affect prediction reliability
Levkovich and Omar [14]Transformer-based models (BERT, LLMs)Achieved improved contextual understanding and semantic accuracy compared to traditional NLP methodsHigh computational cost and resource requirements
Fernandes et al. [15]NLP models applied to psychiatric recordsEnabled early detection of risk-related patterns from clinical textual dataLimited availability of annotated psychiatric datasets
Bejan et al. [16]Text classification using NLP and machine learningImproved identification of individuals at risk through structured classification approachesInsufficient volume of high-quality labeled data
Zhang et al. [17]Deep learning models (CNN, RNN, Transformers)Demonstrated effectiveness in capturing complex linguistic and emotional patternsRequire large annotated datasets and computational resources
Schoene et al. [18]NLP for social determinants of health analysisProvided insights into the relationship between social factors and psycho-emotional riskEthical concerns related to sensitive data usage
Vidal-Arenas et al. [20]Psychological feature extraction from textual dataIdentified key psychological traits (e.g., anxiety, rumination) associated with psycho-emotional riskInterpretation of linguistic features may be subjective
Ji et al. [21]Comparative analysis of machine learning and transformer modelsHighlighted the effectiveness of transformer-based approaches for risk detectionLimited generalizability across datasets and contexts
Velupillai et al. [22]NLP analysis of adolescent mental health recordsDemonstrated the usefulness of clinical text data for early risk identificationRequires domain-specific model adaptation
Haque et al. [23]Machine learning for sentiment-based risk detectionEnabled identification of emotional patterns in textual dataHybrid models require large training datasets
Cohen et al. [24]NLP-based risk prediction using emergency department dataDemonstrated potential for real-time crisis detectionRequires high computational efficiency for real-time processing
Wulz et al. [25]Data science and machine learning in risk predictionHighlighted the role of data-driven approaches in prevention strategiesLack of standardized ethical frameworks
Proposed ApproachTransformer-based NLP + XAI + complementary structured-indicator analysisIntegrates contextual language modeling with explainable AI and a complementary structured-indicator perspective, improving interpretability while broadening the analytical view of psycho-emotional risk.Requires large-scale data, careful bias mitigation, and optimization for real-time deployment
Table 3. Multimodal Feature Categories for Psycho-Emotional Risk Assessment.
Table 3. Multimodal Feature Categories for Psycho-Emotional Risk Assessment.
Feature CategoryTotal FeaturesFeatures UsedCoverage (%)
Lexical Features402972.7
Sentiment Indicators352468.5
Contextual Linguistic Cues382873.1
Behavioral Patterns302066.7
Psychological Indicators322165.6
Table 4. Summary of datasets used for experimental evaluation.
Table 4. Summary of datasets used for experimental evaluation.
DatasetTypeSamplesFeaturesSource
Psychological Crisis DatasetAggregated behavioral/physiological580020https://www.kaggle.com/datasets/programmer3/psychological-crisis-risk-dataset (accessed on 14 February 2026)
Reddit Mental Health DatasetSocial media text5957Textual messageshttps://www.kaggle.com/datasets/neelghoshal/reddit-mental-health-data (accessed on 14 February 2026)
Table 5. Statistical Characteristics of the Social Media Dataset.
Table 5. Statistical Characteristics of the Social Media Dataset.
MetricValue
Total text samples5957
Higher-risk labeled texts32%
Lower/neutral labeled texts68%
Average text length21 tokens
Vocabulary size~12,000 unique tokens
Note: the reported class proportions reflect the labels provided in the public dataset and should not be interpreted as clinician-validated diagnostic categories.
Table 6. Comparative Analysis of Model Configurations in the Proposed Psycho-Emotional Risk Detection Framework.
Table 6. Comparative Analysis of Model Configurations in the Proposed Psycho-Emotional Risk Detection Framework.
Model ConfigurationAccuracy (%)PrecisionRecallF1-Score
TF-IDF + Random Forest90.80.900.900.90
BERT (text only)95.60.950.950.95
BERT + complementary structured indicators (exploratory setting)96.80.960.960.96
BERT + SHAP (proposed model)96.30.960.960.96
Note: the BERT + complementary structured indicators setting was included as an auxiliary exploratory extension and is not the primary proposed model reported in the Abstract. The main proposed model in this study is the BERT-based text classifier with SHAP-based interpretability.
Table 7. Selected previous studies for contextual reference (not directly comparable).
Table 7. Selected previous studies for contextual reference (not directly comparable).
StudyModelDatasetAccuracy
Ji et al. [21]BERTSocial media posts91%
Feroze et al. [4]CNN–LSTMTwitter dataset93%
Broadbent et al. [31]Machine learning classifierCrisis counseling data90%
Proposed approachBERT + Explainable AI (SHAP)Reddit Mental Health Dataset (main text classification setting)96.3%
Note: the studies listed in this table used different datasets, label definitions, preprocessing pipelines, and evaluation protocols. Therefore, the reported accuracy values are included for contextual reference only and should not be interpreted as directly comparable benchmarks.
Table 8. Computational Efficiency Comparison of Different Models.
Table 8. Computational Efficiency Comparison of Different Models.
ModelInference Time (ms)GPU Memory Usage
LSTM382.1 GB
BERT422.8 GB
BERT + SHAP (proposed model)352.4 GB
Note: inference time and GPU memory usage were measured under the same hardware configuration (NVIDIA RTX 3090, 24 GB VRAM) and the same evaluation setting; FLOPs were not directly measured in the present implementation.
Table 9. Performance Evaluation of ML and DL Classifiers.
Table 9. Performance Evaluation of ML and DL Classifiers.
MethodTypeAccuracy (%)PrecisionRecallF1-ScoreAUC
BERT + SHAP (proposed model)DL96.30.960.960.960.98
RoBERTaDL95.80.950.950.950.975
LongformerDL80.640.8080.8060.8070.956
BiLSTMDL93.60.930.930.930.96
LSTMDL93.50.930.930.930.95
Random Forest (RF)ML91.20.910.910.910.964
Support Vector Machine (SVM)ML91.00.900.900.900.960
Stochastic Gradient Descent (SGD)ML90.50.900.900.900.958
Logistic Regression (LR)ML90.20.890.890.890.956
Multinomial Naïve Bayes (MNB)ML84.60.840.840.840.915
Note: the Support Vector Machine baseline was implemented using the SVC classifier.
Table 10. Qualitative case-based interpretation of selected false positive and false negative patterns discussed in the error analysis.
Table 10. Qualitative case-based interpretation of selected false positive and false negative patterns discussed in the error analysis.
Error TypeExample Discussed in the ManuscriptPredicted LabelTrue LabelQualitative SHAP Interpretation SummaryMain Implication
False positive“I am tired of everything”High-riskLow-risk/neutralLexically negative expressions may receive disproportionately high importance, while the broader context still reflects temporary frustration rather than severe psycho-emotional distress.Emotionally loaded wording may trigger overestimation of risk.
False positive“This project is killing me”High-riskLow-risk/neutralThe prediction appears to be driven by isolated metaphorical terms, while the non-literal meaning is not fully captured.Figurative language and sarcasm remain a source of false alarms.
False positiveNeutral or informational discussion of anxiety, stress, or therapyHigh-riskLow-risk/neutralMental-health-related vocabulary may receive elevated importance even when the text is descriptive rather than self-expressive.Mental-health-related keywords alone do not always indicate actual risk.
False negative“It’s over”Low-riskHigh-riskBecause the expression is short and context-poor, key lexical indicators may receive insufficient salience.Brief distress expressions are harder to classify reliably.
False negative“I just want to disappear”Low-riskHigh-riskThe emotional signal is indirect and may not contain enough explicit contextual support for a stable high-risk prediction.Implicit distress can be underestimated by the model.
False negativeUnderrepresented or culturally variable expressions of distressLow-riskHigh-riskThe model appears more sensitive to common patterns observed during training than to rarer formulations of psycho-emotional difficulty.Dataset coverage and linguistic diversity affect generalization.
Note: This table provides a qualitative case-based interpretation derived from the error patterns and illustrative examples discussed in the manuscript. Because detailed token-level SHAP visualizations for individual misclassified samples are not provided in the current version, the interpretation is intentionally limited to conservative qualitative patterns rather than quantitative local feature attributions.
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Bekmurat, O.; Akpanbetov, D.; Tursynkhan, A.; Demeubayeva, L.; Duisenbekkyzy, Z.; Sansyzbay, K.; Kadirkulov, S.; Bakhtiyarova, Y. Explainable and Computationally Efficient NLP Framework for Detecting Psycho-Emotional Risk Signals in Social Media. Computers 2026, 15, 327. https://doi.org/10.3390/computers15050327

AMA Style

Bekmurat O, Akpanbetov D, Tursynkhan A, Demeubayeva L, Duisenbekkyzy Z, Sansyzbay K, Kadirkulov S, Bakhtiyarova Y. Explainable and Computationally Efficient NLP Framework for Detecting Psycho-Emotional Risk Signals in Social Media. Computers. 2026; 15(5):327. https://doi.org/10.3390/computers15050327

Chicago/Turabian Style

Bekmurat, Orazmukhamed, Darkhan Akpanbetov, Ainur Tursynkhan, Laura Demeubayeva, Zhansaya Duisenbekkyzy, Kanibek Sansyzbay, Shingis Kadirkulov, and Yelena Bakhtiyarova. 2026. "Explainable and Computationally Efficient NLP Framework for Detecting Psycho-Emotional Risk Signals in Social Media" Computers 15, no. 5: 327. https://doi.org/10.3390/computers15050327

APA Style

Bekmurat, O., Akpanbetov, D., Tursynkhan, A., Demeubayeva, L., Duisenbekkyzy, Z., Sansyzbay, K., Kadirkulov, S., & Bakhtiyarova, Y. (2026). Explainable and Computationally Efficient NLP Framework for Detecting Psycho-Emotional Risk Signals in Social Media. Computers, 15(5), 327. https://doi.org/10.3390/computers15050327

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop