CoolFace
Modelpublic

techhy/mindtrack-mental-health-analyzer

sourceHugging Facemitupdated 1y agoView on Hugging Face
1likes14downloads
Model Card

MindTrack: Mental Health Sentiment Analyzer ๐Ÿง 

Model Description

MindTrack is a fine-tuned DistilBERT model specifically trained for mental health sentiment analysis and risk detection in text content. The model can classify text into two categories:

  • โ€”Normal: Indicates healthy mental state or neutral content
  • โ€”Risk Detected: Indicates potential mental health concerns that may require attention

Model Details

  • โ€”Model Type: DistilBERT for Sequence Classification
  • โ€”Training Data: Curated mental health dataset with balanced samples
  • โ€”Languages: English
  • โ€”License: MIT

Performance

The model achieves the following performance on the validation set:

  • โ€”Overall Accuracy: 97.13%
  • โ€”Overall F1-Score: 97.13%
  • โ€”Normal Class F1: 97.16%
  • โ€”Risk Class F1: 97.10%

Dataset

The model was trained on a perfectly balanced dataset.

  • โ€”Total Samples: 50,000
  • โ€”Training Samples: 40,000 (80%)
  • โ€”Validation Samples: 10,000 (20%)
  • โ€”Class Balance: 50/50

Usage

python
from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch

# Load model and tokenizer
model_id = "techhy/mindtrack-mental-health-analyzer"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForSequenceClassification.from_pretrained(model_id)

# Example usage
text = "I am feeling great today!"
inputs = tokenizer(text, return_tensors="pt", truncation=True, padding=True, max_length=512)

with torch.no_grad():
    outputs = model(**inputs)
    probabilities = torch.softmax(outputs.logits, dim=-1)
    predicted_class = torch.argmax(probabilities, dim=-1).item()
    confidence = probabilities[0][predicted_class].item()

labels = {0: "Normal", 1: "Risk Detected"}
print(f"Prediction: {labels[predicted_class]} (Confidence: {confidence:.2%})")

Intended Use

This model is designed to assist in identifying potential mental health concerns in text content. Important: This tool should not replace professional medical advice or diagnosis. Always consult qualified healthcare professionals for mental health issues.

Limitations

  • โ€”Trained primarily on English text
  • โ€”May not capture cultural nuances in mental health expression
  • โ€”Performance may vary on text significantly different from training data
  • โ€”Should be used as a screening tool, not for final diagnosis

Training Data

The model was trained on a carefully curated dataset of mental health-related text, including:

  • โ€”Social media posts (anonymized)
  • โ€”Mental health support forum discussions
  • โ€”Clinical text samples (anonymized)
  • โ€”Balanced representation of risk and normal states

Ethical Considerations

  • โ€”Privacy: No personal information was used in training
  • โ€”Bias: Efforts were made to reduce bias, but some may remain
  • โ€”Responsible Use: Should be used to help people, not to discriminate
  • โ€”Professional Guidance: Always recommend professional help for mental health concerns

Citation

If you use this model in your research or applications, please cite:

@misc{mindtrack2024,
  title={MindTrack: Mental Health Sentiment Analyzer},
  author={Soham},
  year={2024},
  url={https://huggingface.co/techhy/mindtrack-mental-health-analyzer}
}

Contact

For questions or issues, please open an issue on the GitHub repository.