A machine learning approach for text pattern diagnosis in mental health consultations

Online health consultation services are crucial for mental health support, particularly in densely populated areas. However, the heavy reliance on human expertise often leads to delays, necessitating more efficient and automated solutions. This study developed a machine learning framework to automate doctor response patterns for mental health questions — focusing on anxiety, depression, and stress — using clinically validated data from an Indonesian Online health consultation platform. We performed comprehensive text preprocessing, including duplicate removal, special character elimination, case folding, stopword removal, tokenization, lemmatization, and part-of-speech tagging, and evaluated four feature extraction methods: Word2Vec, Bag-of-Words, N-Gram, and Global Vectors for Word Representation. Five machine learning algorithms — Naïve Bayes, K-Nearest Neighbors, Random Forest, Neural Network, and Gradient Boosting — were tested, along with hybrid models combining Bagging Classifier or Genetic Algorithm. The results showed that Gradient Boosting achieved the highest accuracy (0.842) among standalone models, with high precision (0.858) and F1-score (0.864) for depression prediction, and recall (0.850) and F1-score (0.856) for stress prediction. The Gradient Boosting-Bagging Classifier hybrid matched this accuracy (0.842), while the Gradient Boosting-Genetic Algorithm hybrid showed superior performance for anxiety prediction (precision: 0.888, recall: 0.816). N-Gram and Bag-of-Words methods and the 90:10 and 70:30 train–test splits consistently produced optimal results. This work demonstrates that machine learning can automate mental health responses at scale, with Gradient Boosting balancing accuracy and efficiency. Future research will explore transformer-based models and multilingual validation to improve broader implementation. • Develop a machine learning framework to classify mental health topics in doctor responses. • Evaluate feature extraction methods to optimize text pattern recognition. • Identify Gradient Boosting as the most effective standalone model. • Demonstrate that hybrid models enhance precision and recall for anxiety prediction. • Recommend advanced embeddings for improved contextual understanding in responses.

Authors

Institutions

Publication Details

Journal
Decision Analytics Journal
Published
2025-04-15
DOI
https://doi.org/10.1016/j.dajour.2025.100572
Citations
4
Primary Topic
Mental Health via Writing
Type
article
Field-Weighted Citation Impact
9.75
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

A machine learning approach for text pattern diagnosis in mental health consultations

Mauridhi Hery Purnomo, Mohammad Syafrullah, Wiwik Anggraeni, Safitri Juanita et al.
4 citations
Decision Analytics Journal
Mental Health via Writing
9.75
article

A machine learning approach for text pattern diagnosis in mental health consultations

Mauridhi Hery Purnomo, Mohammad Syafrullah, Wiwik Anggraeni, Safitri Juanita, Anisah Hasratniwati Daeli
article en
4 citations

Abstract

Online health consultation services are crucial for mental health support, particularly in densely populated areas. However, the heavy reliance on human expertise often leads to delays, necessitating more efficient and automated solutions. This study developed a machine learning framework to automate doctor response patterns for mental health questions — focusing on anxiety, depression, and stress — using clinically validated data from an Indonesian Online health consultation platform. We performed comprehensive text preprocessing, including duplicate removal, special character elimination, case folding, stopword removal, tokenization, lemmatization, and part-of-speech tagging, and evaluated four feature extraction methods: Word2Vec, Bag-of-Words, N-Gram, and Global Vectors for Word Representation. Five machine learning algorithms — Naïve Bayes, K-Nearest Neighbors, Random Forest, Neural Network, and Gradient Boosting — were tested, along with hybrid models combining Bagging Classifier or Genetic Algorithm. The results showed that Gradient Boosting achieved the highest accuracy (0.842) among standalone models, with high precision (0.858) and F1-score (0.864) for depression prediction, and recall (0.850) and F1-score (0.856) for stress prediction. The Gradient Boosting-Bagging Classifier hybrid matched this accuracy (0.842), while the Gradient Boosting-Genetic Algorithm hybrid showed superior performance for anxiety prediction (precision: 0.888, recall: 0.816). N-Gram and Bag-of-Words methods and the 90:10 and 70:30 train–test splits consistently produced optimal results. This work demonstrates that machine learning can automate mental health responses at scale, with Gradient Boosting balancing accuracy and efficiency. Future research will explore transformer-based models and multilingual validation to improve broader implementation. • Develop a machine learning framework to classify mental health topics in doctor responses. • Evaluate feature extraction methods to optimize text pattern recognition. • Identify Gradient Boosting as the most effective standalone model. • Demonstrate that hybrid models enhance precision and recall for anxiety prediction. • Recommend advanced embeddings for improved contextual understanding in responses.

Decision Analytics JournalVol. 15
Sepuluh Nopember Institute of Technology (ID), Universitas Budi Luhur (ID)
Openalex Percentile: Top 2%
Mental Health via Writing
9.75
AI Navigator

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

Summarize Papers & Methodologies

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

Benchmark Rankings & Visual Analytics

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

Connect Distant Disciplines

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