MentalLLaMA  by SteveKGYang

Open-source LLM for interpretable mental health analysis

created 1 year ago
275 stars

Top 94.9% on sourcepulse

GitHubView on GitHub
Project Summary

MentaLLaMA provides open-source instruction-following large language models for interpretable mental health analysis on social media. It targets researchers and developers needing to analyze mental health discourse and generate explanations, offering a novel dataset and benchmark for this specialized domain.

How It Works

MentaLLaMA is built upon LLaMA and Vicuna foundation models, fine-tuned on the Interpretable Mental Health Instruction (IMHI) dataset. This dataset comprises 105K instruction samples across 8 mental health analysis tasks derived from public social media data. The models are designed to follow instructions for mental health analysis and provide high-quality, interpretable explanations for their predictions.

Quick Start & Requirements

  • Installation: Use Hugging Face Transformers library.
  • Dependencies: Python, PyTorch, Transformers, PEFT (for LoRA models). GPU recommended for inference.
  • Model Loading (Example):
    from transformers import LlamaTokenizer, LlamaForCausalLM
    tokenizer = LlamaTokenizer.from_pretrained(MODEL_PATH)
    model = LlamaForCausalLM.from_pretrained(MODEL_PATH, device_map='auto')
    
  • MentaLLaMA-33B-lora: Requires downloading Vicuna-33B separately and placing it in ./vicuna-33B.
  • Resources: Larger models (13B, 33B) require significant VRAM.
  • Docs: MentaLLaMA Paper, Evaluation Paper

Highlighted Details

  • Offers 5 model checkpoints: MentaLLaMA-33B-lora, MentaLLaMA-chat-13B, MentaLLaMA-chat-7B, MentalBART, MentalT5.
  • Includes the IMHI dataset (105K instruction samples) and a benchmark (19K test samples) for interpretable mental health analysis.
  • Provides 10 pre-trained classifiers (based on MentalBERT) for evaluating model output correctness on the IMHI benchmark.
  • Supports evaluation using BART-score for explanation quality.

Maintenance & Community

  • Active development with recent updates in March 2024 (test data release) and February 2024 (paper acceptance).
  • Primary contributors are affiliated with the National Centre for Text Mining and The University of Manchester.

Licensing & Compatibility

  • Licensed under the MIT License.
  • Permits commercial use and linking with closed-source projects.

Limitations & Caveats

  • The project is strictly for non-clinical research; it does not provide diagnosis or advice.
  • Users assume all risk; authors disclaim responsibility for errors or consequences.
  • LLMs may introduce biases, incorrect predictions, or inappropriate explanations, posing challenges for real-world deployment.
Health Check
Last commit

1 year ago

Responsiveness

Inactive

Pull Requests (30d)
0
Issues (30d)
0
Star History
17 stars in the last 90 days

Explore Similar Projects

Feedback? Help us improve.