Comparing Traditional Machine Learning and Large Language Models: An Application to Mental Health Text Classification
Skip to main content
eScholarship
Open Access Publications from the University of California

UCLA

UCLA Electronic Theses and Dissertations bannerUCLA

Comparing Traditional Machine Learning and Large Language Models: An Application to Mental Health Text Classification

Abstract

Mental health conditions profoundly affect individuals worldwide, yet their early detectionand diagnosis remain complex. This thesis investigates the application of machine learn- ing and large language models (LLMs) for classifying mental health conditions based on textual data. Traditional models, including Logistic Regression, Support Vector Machines (SVM), and Random Forest, were evaluated alongside the fine-tuned Llama 3.1-8B LLM. Preprocessing steps, such as text cleaning and vectorization using Term Frequency-Inverse Document Frequency (TF-IDF), facilitated effective feature extraction. The Llama 3.1-8B achieved superior performance, with an accuracy of 86%, compared to 76% for traditional models, while also excelling in capturing nuanced linguistic patterns. However, traditional models demonstrated advantages in interpretability and computational efficiency. This study underscores the potential of LLMs in advancing automated mental health assessments while emphasizing the importance of ethical considerations and model transparency in real-world applications.

Main Content
For improved accessibility of PDF content, download the file to your device.
Current View