Detecting depression: employing word-embeddings and sentence transformers
摘要
Detecting Depression in individuals can prevent significant amounts of mental anguish. This study expands on our previous work, “Detecting Depression: Employing Natural Language Processing and Random Forests”, and further explores the potential of machine learning in detecting Depression from text. Previously, we curated a dataset of 291 Depression and 698 Control text posts obtained from Reddit. Using TF-IDF features, we trained Random Forest classifiers and achieved an F1 score of 93.24% and an accuracy of 93.21%. Treating this as our baseline, we now evaluate GLoVe word embeddings and Sentence Transformer models for feature extraction. We employ Random Forest, Logistic Regression and Multi-Layer Perceptron classifiers for supervised classification. Our results show that GLoVe embeddings outperform the baseline (F1 score: 94.91%, accuracy: 94.79%). Additionally, our four Sentence Transformers (All MiniLM L6 v2, All MPNet base v2, GTR T5 base and Sentence T5 base) achieve substantially higher results. Our best-performing model uses All MPNet base v2 base transformer embeddings, SMOTE class balancing and a tuned Random Forest classifier to achieve an F1 score of 98.04% and a classification accuracy of 98.07%, outperforming state-of-the-art transformers such as DepRoBERTa. Finally, we discuss the possibility of real-world and clinical applications, along with the various associated ethical considerations and caveats.