Social media platforms have emerged as valuable sources for mental health research, enabling the detection of conditions such as depression through analyses of user-generated posts. This manuscript offers practical, step-by-step guidance for applying machine learning and deep learning methods to mental health detection on social media. Key topics include strategies for handling heterogeneous and imbalanced datasets, advanced text preprocessing, robust model evaluation, and the use of appropriate metrics beyond accuracy. Real-world examples illustrate each stage of the process, and an emphasis is placed on transparency, reproducibility, and ethical best practices. While the present work focuses on text-based analysis, we discuss the limitations of this approach—including label inconsistency and a lack of clinical validation—and highlight the need for future research to integrate multimodal signals and gold-standard psychometric assessments. By sharing these frameworks and lessons, this manuscript aims to support the development of more reliable, generalizable, and ethically responsible models for mental health detection and early intervention.
9 February 2026 in Journal of Computational Social Science
Spam on messaging apps like Telegram is a serious threat to user security andexperience. In this paper, we compared several machine learning (ML) and deep learning (DL)models to find the most effective way to detect it. We tested our models on a dataset of 20,348messages. We put classic approaches like Logistic Regression and Tree-based Modelsincluding bagging and boosting against modern neural networks—a GRU and the ALBERTtransformer. The results demonstrate that both GRU and ALBERT were the clear winners. TheALBERT model was the top performer, achieving state-of-the-art results with a weightedF1-score of 0.97 and an AUC of 0.9943. The GRU model also delivered excellent performance,with an F1-score of 0.94. Their real strength was in identifying the tricky minority ‘spam’class. Here, ALBERT reached an F1-score of 0.95, and the GRU model scored 0.90,significantly outperforming the other methods. We used McNemar's test to confirm thesefindings were statistically significant. Ultimately, our study sets a new benchmark for spamdetection. It proves that transformer models can effectively secure messaging platforms usingonly the content of the message itself.
Detecting toxic language in user-generated text remains a critical challenge due tolinguistic nuance, evolving expressions, and severe class imbalance. While Transformer-basedmodels have established state-of-the-art performance, their significant computational costs posescalability barriers for real-time moderation. We investigate whether integrating social andcontextual metadata—such as user reactions and platform ratings—can bridge the performancegap between computationally efficient classical models and modern deep learningarchitectures. Using a 40,000-comment subset of the Jigsaw Toxic Comment ClassificationChallenge, we conduct a controlled, two-phase comparison. We evaluatea Baseline configuration (TF-IDF for classical ensembles vs. raw text for ALBERT) againstan Enhanced configuration that fuses text representations with explicit social signals. Ourinvestigation analyzes whether these high-fidelity metadata features allow lightweight models(e.g., LightGBM) to rival the discriminative power of deep Transformers. The findingschallenge the prevailing assumption that deep semantic understanding is strictly necessary forhigh-performance toxicity detection, offering significant implications for the design of scalable,"Green AI" moderation systems.
Instant messaging platforms such as Telegram enable rapid information exchange butalso facilitate deceptive messaging at scale. In this study, we examine Telegram spamdetection through a hierarchy of models that vary in linguistic modeling capacity, frominterpretable lexical baselines (Logistic Regression, Random Forest, LightGBM) tosequential (GRU) and context-aware transformer representations (ALBERT). Usinga harmonized preprocessing and evaluation pipeline on 20,348 labeled messages, wecompare predictive performance across metrics (F1, ROC–AUC, PR–AUC, calibra-tion) and assess pairwise differences via McNemar’s test with multiple-comparisoncorrection. Across all metrics, ALBERT achieves the strongest performance and sub-stantially improves spam-class detection relative to lexical models. This performancegap is consistent with the presence of a subset of deceptive messages whose signals areless concentrated in surface keywords and more distributed across context. However,improved performance may also reflect differences in model capacity and inductivebias, benefits from large-scale pretraining, and stronger handling of sparse patternsvia contextual and subword representations. Accordingly, we interpret the proposed“complex tier” as an operational characterization of lexically subtle spam in this cor-pus, and we suggest that keyword-based moderation may be insufficient on its own tocapture the full spectrum of deceptive messaging observed here.