Downloads · 30 days
4
1% of all-time downloads
tahaenesaslanturk/mental-health-classification-v0.2
mental-health-classification-v0.2 is a text classification model from tahaenesaslanturk. Use it when you need a label for a piece of text. It is set up for transformers. The card lists the license as mit.
This model is designed to classify texts into different mental health categories. It uses 2% of the dataset from the following study:
Downloads · 30 days
4
1% of all-time downloads
All-time downloads
483
Public
Parameters
335M
1.3 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors1.3 GB · 100%
From the Hugging Face model README
This model is designed to classify texts into different mental health categories. It uses 2% of the dataset from the following study:
@article{low2020natural,
title={Natural Language Processing Reveals Vulnerable Mental Health Support Groups and Heightened Health Anxiety on Reddit During COVID-19: Observational Study},
author={Low, Daniel M and Rumker, Laurie and Torous, John and Cecchi, Guillermo and Ghosh, Satrajit S and Talkar, Tanya},
journal={Journal of medical Internet research},
volume={22},
number={10},
pages={e22635},
year={2020},
publisher={JMIR Publications Inc., Toronto, Canada}
}
This model is fine-tuned to classify texts into the following mental health categories:
An example usage of the model is:
from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch
# Load the tokenizer and model
tokenizer = AutoTokenizer.from_pretrained("tahaenesaslanturk/mental-health-classification-v0.2")
model = AutoModelForSequenceClassification.from_pretrained("tahaenesaslanturk/mental-health-classification-v0.2")
# Encode the input text
input_text = "I struggle with my relationship with food and my body image, often feeling guilt or shame after eating."
inputs = tokenizer(input_text, return_tensors="pt")
# Perform inference
with torch.no_grad():
outputs = model(**inputs)
# Get the predicted label
predicted_label = torch.argmax(outputs.logits, dim=1).item()
label = model.config.id2label[predicted_label]
print(f"Predicted label: {label}")