SoulChat  by scutcyr

LLM for mental health dialogue in Chinese

created 2 years ago
645 stars

Top 52.6% on sourcepulse

GitHubView on GitHub
Project Summary

SoulChat is an open-source Chinese large language model specifically designed for mental health and life space proactive health applications. It aims to improve LLMs' empathy, listening, and comfort abilities through fine-tuning with extensive multi-turn empathy conversation data, targeting researchers and developers in the mental health domain.

How It Works

SoulChat is built upon the ProactiveHealthGPT foundation model. It was fine-tuned using a hybrid dataset combining single-turn long-text psychological counseling instructions and multi-turn empathetic conversations. This approach addresses the observed gap in current LLMs, which often provide direct advice rather than engaging in the gradual, empathetic dialogue characteristic of human psychological counseling. The model was initialized with ChatGLM-6B weights and underwent full parameter fine-tuning.

Quick Start & Requirements

  • Install: Clone the repository and create a conda environment using proactivehealthgpt_py38.yml. Install PyTorch with CUDA 11.6 support (e.g., torch==1.13.1+cu116).
  • Prerequisites: Python 3.8, CUDA 11.6, PyTorch 1.13.1. Additional dependencies include cpm_kernels, rouge_chinese, nltk, jieba, datasets, streamlit, and streamlit_chat.
  • Usage: Load the model using Hugging Face's transformers library. Example Python code for single and multi-turn conversations is provided. A Streamlit demo app is available via streamlit run soulchat_app.py --server.port 9026.
  • Resources: Requires a GPU with CUDA 11.6.

Highlighted Details

  • Fine-tuned on a custom dataset exceeding 1.2 million samples, including over 150,000 single-turn instructions and ~1 million multi-turn conversation turns.
  • The project includes the open-sourced SoulChatCorpus dataset (version 2.0 released June 2024).
  • The associated paper "SoulChat: Improving LLMs’ Empathy, Listening, and Comfort Abilities through Fine-tuning with Multi-turn Empathy Conversations" was accepted at Findings of EMNLP 2023.
  • The model is integrated into the broader ProactiveHealthGPT framework, which also includes the BianQue model for general health dialogue.

Maintenance & Community

The project is initiated by South China University of Technology, Future Technology College, and the Guangdong Key Laboratory of Digital Human. It has received media coverage from major Chinese outlets.

Licensing & Compatibility

The project uses weights from ChatGLM-6B and is therefore restricted to non-commercial research purposes only, adhering to the ChatGLM-6B model license. Commercial use, military, or illegal purposes are strictly prohibited.

Limitations & Caveats

The model's output is stochastic and should not replace professional medical or psychological diagnosis or advice. Users bear all risks associated with its use. The project explicitly warns against over-reliance and prolonged engagement with the model.

Health Check
Last commit

1 year ago

Responsiveness

Inactive

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

Explore Similar Projects

Feedback? Help us improve.