{"title":"A machine learning approach for text pattern diagnosis in mental health consultations","authors":"Safitri Juanita , Anisah Hasratniwati Daeli , Mohammad Syafrullah , Wiwik Anggraeni , Mauridhi Hery Purnomo","doi":"10.1016/j.dajour.2025.100572","DOIUrl":null,"url":null,"abstract":"<div><div>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.</div></div>","PeriodicalId":100357,"journal":{"name":"Decision Analytics Journal","volume":"15 ","pages":"Article 100572"},"PeriodicalIF":0.0000,"publicationDate":"2025-04-15","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"Decision Analytics Journal","FirstCategoryId":"1085","ListUrlMain":"https://www.sciencedirect.com/science/article/pii/S2772662225000281","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 0
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.
在线健康咨询服务对于心理健康支持至关重要,特别是在人口稠密地区。然而,对人类专业知识的严重依赖经常导致延误,需要更有效和自动化的解决方案。本研究开发了一个机器学习框架,利用来自印度尼西亚在线健康咨询平台的临床验证数据,使医生对心理健康问题(关注焦虑、抑郁和压力)的反应模式自动化。我们进行了全面的文本预处理,包括重复去除、特殊字符消除、大小写折叠、停止词去除、标记化、词法化和词性标注,并评估了四种特征提取方法:Word2Vec、Bag-of-Words、N-Gram和Global Vectors for Word Representation。测试了五种机器学习算法- Naïve贝叶斯,k近邻,随机森林,神经网络和梯度增强,以及结合Bagging分类器或遗传算法的混合模型。结果表明,Gradient Boosting在独立模型中准确率最高(0.842),其中预测抑郁的准确率最高(0.858),f1评分最高(0.864),预测应力的召回率最高(0.850),f1评分最高(0.856)。梯度提升-套袋分类器混合预测的准确率为0.842,而梯度提升-遗传算法混合预测的焦虑预测准确率为0.888,召回率为0.816。N-Gram和Bag-of-Words方法以及90:10和70:30训练测试分割始终产生最佳结果。这项工作表明,机器学习可以大规模地自动化心理健康反应,并具有梯度提升平衡的准确性和效率。未来的研究将探索基于转换器的模型和多语言验证,以改善更广泛的实施。