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.