CoolFace
Modelpublic

elishaw/deberta_mental

sourceHugging Facemitupdated 11mo agoView on Hugging Face
1likes27downloads
Model Card

DeBERTa Mental Health Classification Model

A fine-tuned DeBERTa v3 small model for detecting mental health conditions from text.

Model Description

This model is based on microsoft/deberta-v3-small and has been fine-tuned to classify text into 8 mental health categories.

Training Data

This model was trained on the following datasets:

Labels

The model can classify text into the following categories:

IDLabelDescription
0NormalNo mental health concerns detected
1OffmychestGeneral venting/sharing
2DepressionDepression-related content
3AnxietyAnxiety-related content
4StressStress-related content
5BipolarBipolar disorder-related content
6Personality disorderPersonality disorder-related content
7SuicidalSuicidal ideation (⚠️ requires immediate attention)

Usage

python
from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch

# Load model and tokenizer
model_path = "deberta-illness"
tokenizer = AutoTokenizer.from_pretrained(model_path)
model = AutoModelForSequenceClassification.from_pretrained(model_path)

# Example text
text = "I've been feeling down lately and can't seem to enjoy anything anymore."

# Tokenize and predict
inputs = tokenizer(text, return_tensors="pt", truncation=True, max_length=512)
outputs = model(**inputs)
predictions = torch.nn.functional.softmax(outputs.logits, dim=-1)

# Get predicted label
predicted_class = torch.argmax(predictions, dim=-1).item()
confidence = predictions[0][predicted_class].item()

print(f"Predicted: {model.config.id2label[str(predicted_class)]}")
print(f"Confidence: {confidence:.2%}")

Model Architecture

  • Base Model: microsoft/deberta-v3-small
  • Hidden Size: 768
  • Attention Heads: 12
  • Hidden Layers: 6
  • Max Sequence Length: 512 tokens
  • Vocabulary Size: 128,100

License

Please refer to the original microsoft/deberta-v3-small license and any additional licensing terms from the fine-tuning dataset.