scdong's picture
Update README.md
289325a verified
metadata
license: mit
language:
  - en

🧠 DistilBERT Response Type Classifier

This is a fine-tuned DistilBERT model designed to classify patient messages into one of four mental health support categories:

  • advice
  • information
  • question
  • validation

It is used as part of the Mental Health Counselor Assistant app to help generate helpful, therapeutic responses.

πŸ’Ό Use Case

Given a short text input from a patient, this model predicts the most appropriate type of response a mental health counselor might provide.

Example:

from transformers import DistilBertForSequenceClassification, DistilBertTokenizerFast
import torch

model = DistilBertForSequenceClassification.from_pretrained("scdong/distilbert-response-type")
tokenizer = DistilBertTokenizerFast.from_pretrained("scdong/distilbert-response-type")

text = "I just feel so overwhelmed lately"
inputs = tokenizer(text, return_tensors="pt")
with torch.no_grad():
    logits = model(**inputs).logits

predicted_label = torch.argmax(logits, dim=1).item()
print(predicted_label)  # Maps to: 0=advice, 1=information, 2=question, 3=validation

The model is used to route text to custom prompt templates like:

  • Advice prompt: β€œYou are a licensed counselor. What supportive advice would you give to someone who said: {msg}?”
  • Validation prompt: β€œYou are an empathetic therapist. Validate the client’s emotions in response to: {msg}”

πŸ“ Files

This repo includes:

  • config.json β€” model architecture config
  • model.safetensors β€” trained model weights
  • tokenizer_config.json, tokenizer.json, vocab.txt β€” tokenizer files
  • special_tokens_map.json β€” optional token mappings
  • training_args.bin β€” training metadata (optional)

πŸ§ͺ Training Details

The model was fine-tuned using a balanced dataset labeled with response types based on:

The final model was validated on a held-out test set and integrated into the counselor assistant tool.

πŸ“œ License

This model is released under an open license for research and educational purposes. Please use responsibly and do not deploy for unsupervised clinical use.