Update README.md
Browse files
README.md
CHANGED
|
@@ -1,3 +1,53 @@
|
|
| 1 |
---
|
| 2 |
license: apache-2.0
|
| 3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
license: apache-2.0
|
| 3 |
---
|
| 4 |
+
# MindGLM: A Fine-tuned Language Model for Chinese Psychological Counseling
|
| 5 |
+
1. Introduction
|
| 6 |
+
MindGLM is a large language model fine-tuned and aligned for the task of psychological counseling in Chinese. Developed from the foundational model ChatGLM2-6B, MindGLM is designed to resonate with human preferences in psychological inquiries, offering a reliable and safe tool for digital psychological counseling.
|
| 7 |
+
|
| 8 |
+
2. Key Features
|
| 9 |
+
Fine-tuned for Counseling: MindGLM has been meticulously trained to understand and respond to psychological inquiries, ensuring empathetic and accurate responses.
|
| 10 |
+
|
| 11 |
+
Aligned with Human Preferences: The model underwent a rigorous alignment process, ensuring its responses are in line with human values and preferences in the realm of psychological counseling.
|
| 12 |
+
|
| 13 |
+
High Performance: MindGLM has demonstrated superior performance in both quantitative and qualitative evaluations, making it a leading choice for digital psychological interventions.
|
| 14 |
+
|
| 15 |
+
4. Usage
|
| 16 |
+
To use MindGLM with the Hugging Face Transformers library:
|
| 17 |
+
|
| 18 |
+
'''
|
| 19 |
+
python
|
| 20 |
+
Copy code
|
| 21 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
| 22 |
+
|
| 23 |
+
tokenizer = AutoTokenizer.from_pretrained("ZhangCNN/MindGLM")
|
| 24 |
+
model = AutoModelForCausalLM.from_pretrained("ZhangCNN/MindGLM")
|
| 25 |
+
|
| 26 |
+
input_text = "Your input text here"
|
| 27 |
+
input_ids = tokenizer.encode(input_text, return_tensors="pt")
|
| 28 |
+
output = model.generate(input_ids)
|
| 29 |
+
decoded_output = tokenizer.decode(output[0], skip_special_tokens=True)
|
| 30 |
+
print(decoded_output)
|
| 31 |
+
'''
|
| 32 |
+
|
| 33 |
+
5. Training Data
|
| 34 |
+
MindGLM was trained using a combination of open-source datasets and self-constructed datasets, ensuring a comprehensive understanding of psychological counseling scenarios. The datasets include SmileConv, comparison_data_v1, psychology-RLAIF, rm_labelled_180, and rm_gpt_375.
|
| 35 |
+
|
| 36 |
+
6. Training Process
|
| 37 |
+
The model underwent a three-phase training approach:
|
| 38 |
+
|
| 39 |
+
Supervised Fine-tuning: Using the ChatGLM2-6B foundational model, MindGLM was fine-tuned with a dedicated dataset for psychological counseling.
|
| 40 |
+
|
| 41 |
+
Reward Model Training: A reward model was trained to evaluate and score the responses of the fine-tuned model.
|
| 42 |
+
|
| 43 |
+
Reinforcement Learning: The model was further aligned using the PPO (Proximal Policy Optimization) algorithm to ensure its responses align with human preferences.
|
| 44 |
+
|
| 45 |
+
7. Limitations
|
| 46 |
+
While MindGLM is a powerful tool, users should be aware of its limitations:
|
| 47 |
+
|
| 48 |
+
It is designed for psychological counseling but should not replace professional medical advice or interventions.
|
| 49 |
+
|
| 50 |
+
The model's responses are based on the training data, and while it's aligned with human preferences, it might not always provide the most appropriate response.
|
| 51 |
+
|
| 52 |
+
8. License
|
| 53 |
+
Please refer to the licensing terms of the datasets used for training. Usage of MindGLM should be in compliance with these licenses.license: apache-2.0
|