Spaces:
Running
Running
Update README.md
Browse files
README.md
CHANGED
|
@@ -1,12 +1,124 @@
|
|
| 1 |
---
|
| 2 |
-
title:
|
| 3 |
-
emoji:
|
| 4 |
-
colorFrom:
|
| 5 |
-
colorTo:
|
| 6 |
sdk: gradio
|
| 7 |
-
sdk_version:
|
| 8 |
app_file: app.py
|
| 9 |
pinned: false
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
---
|
| 11 |
|
| 12 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
+
title: Psychology AI Assistant
|
| 3 |
+
emoji: π§
|
| 4 |
+
colorFrom: purple
|
| 5 |
+
colorTo: blue
|
| 6 |
sdk: gradio
|
| 7 |
+
sdk_version: 4.44.0
|
| 8 |
app_file: app.py
|
| 9 |
pinned: false
|
| 10 |
+
license: apache-2.0
|
| 11 |
+
models:
|
| 12 |
+
- Qwen/Qwen2.5-0.5B
|
| 13 |
+
- phxdev/psychology-qwen-0.5b
|
| 14 |
+
tags:
|
| 15 |
+
- psychology
|
| 16 |
+
- mental-health
|
| 17 |
+
- therapy
|
| 18 |
+
- counseling
|
| 19 |
+
- peft
|
| 20 |
+
- qwen
|
| 21 |
+
- fine-tuned
|
| 22 |
---
|
| 23 |
|
| 24 |
+
# π§ Psychology AI Assistant
|
| 25 |
+
|
| 26 |
+
An empathetic AI assistant fine-tuned for psychology and mental health support. Based on Qwen 2.5-0.5B with specialized training using PEFT/LoRA techniques.
|
| 27 |
+
|
| 28 |
+
## β¨ Features
|
| 29 |
+
|
| 30 |
+
- **Empathetic Responses**: Fine-tuned specifically for psychology and mental health conversations
|
| 31 |
+
- **Multiple Support Styles**: Choose from therapeutic, supportive friend, crisis support, anxiety coaching, or mindfulness guidance
|
| 32 |
+
- **Evidence-Based Approach**: Responses grounded in psychological principles and therapeutic techniques
|
| 33 |
+
- **Interactive Interface**: Modern, accessible design with conversation starters and customizable settings
|
| 34 |
+
- **Privacy-Focused**: No conversation data is stored or logged
|
| 35 |
+
|
| 36 |
+
## π― Model Details
|
| 37 |
+
|
| 38 |
+
- **Base Model**: [Qwen/Qwen2.5-0.5B](https://huggingface.co/Qwen/Qwen2.5-0.5B)
|
| 39 |
+
- **Fine-tuned Model**: [phxdev/psychology-qwen-0.5b](https://huggingface.co/phxdev/psychology-qwen-0.5b)
|
| 40 |
+
- **Training Method**: PEFT (Parameter Efficient Fine-Tuning) with LoRA
|
| 41 |
+
- **Specialization**: Psychology, mental health, therapeutic communication
|
| 42 |
+
- **Parameters**: ~500M parameters (0.5B)
|
| 43 |
+
- **Context Length**: 2048 tokens
|
| 44 |
+
|
| 45 |
+
## π How to Use
|
| 46 |
+
|
| 47 |
+
1. **Start a Conversation**: Type your thoughts, concerns, or questions in the chat box
|
| 48 |
+
2. **Choose Your Style**: Select the type of support you prefer from the dropdown menu
|
| 49 |
+
3. **Adjust Settings**: Customize response creativity and length to your preference
|
| 50 |
+
4. **Try Examples**: Click on any of the conversation starters for common scenarios
|
| 51 |
+
|
| 52 |
+
### Support Styles Available:
|
| 53 |
+
|
| 54 |
+
- **π¬ Therapeutic**: Professional therapist approach with validation and structured guidance
|
| 55 |
+
- **π₯ Supportive Friend**: Warm, caring friend who studied psychology
|
| 56 |
+
- **π Crisis Support**: Immediate support and grounding techniques for crisis situations
|
| 57 |
+
- **π° Anxiety Coach**: Specialized techniques for managing anxiety and panic
|
| 58 |
+
- **π§ Mindfulness Guide**: Present-moment awareness and self-compassion practices
|
| 59 |
+
|
| 60 |
+
## β οΈ Important Disclaimer
|
| 61 |
+
|
| 62 |
+
This AI assistant provides supportive guidance based on psychological principles, but it is **not a replacement for professional therapy or medical advice**.
|
| 63 |
+
|
| 64 |
+
If you're experiencing a mental health crisis, please contact:
|
| 65 |
+
- **988 Suicide & Crisis Lifeline**: Call or text 988
|
| 66 |
+
- **Crisis Text Line**: Text HOME to 741741
|
| 67 |
+
- **Emergency Services**: Call 911 (US) or your local emergency number
|
| 68 |
+
|
| 69 |
+
## π οΈ Technical Implementation
|
| 70 |
+
|
| 71 |
+
The model uses advanced prompt engineering and fine-tuning techniques to provide contextually appropriate responses:
|
| 72 |
+
|
| 73 |
+
- **PEFT Training**: Efficient fine-tuning preserving base model capabilities while adding psychology specialization
|
| 74 |
+
- **Prompt Templates**: Multiple specialized templates for different therapeutic approaches
|
| 75 |
+
- **Response Quality**: Built-in safeguards against generic or unhelpful responses
|
| 76 |
+
- **Mobile Optimized**: Responsive design works well on all devices
|
| 77 |
+
|
| 78 |
+
## π¨ Interface Features
|
| 79 |
+
|
| 80 |
+
- **Clean Design**: Modern, calming interface designed for sensitive conversations
|
| 81 |
+
- **Conversation History**: Full chat history maintained during your session
|
| 82 |
+
- **Example Prompts**: Curated conversation starters for common mental health topics
|
| 83 |
+
- **Accessibility**: Screen reader friendly and keyboard navigable
|
| 84 |
+
- **Privacy**: No data logging or conversation storage
|
| 85 |
+
|
| 86 |
+
## π§ Model Performance
|
| 87 |
+
|
| 88 |
+
The fine-tuned model shows significant improvements over the base Qwen model in:
|
| 89 |
+
|
| 90 |
+
- **Empathy**: Better emotional validation and understanding
|
| 91 |
+
- **Practical Advice**: More actionable, specific guidance
|
| 92 |
+
- **Psychological Awareness**: Understanding of mental health concepts and terminology
|
| 93 |
+
- **Conversational Flow**: Natural, supportive dialogue without generic responses
|
| 94 |
+
|
| 95 |
+
## π Example Use Cases
|
| 96 |
+
|
| 97 |
+
- **Stress Management**: Work stress, academic pressure, life transitions
|
| 98 |
+
- **Anxiety Support**: Panic attacks, social anxiety, general worry
|
| 99 |
+
- **Relationship Guidance**: Communication skills, boundary setting, conflict resolution
|
| 100 |
+
- **Self-Esteem**: Building confidence, overcoming negative self-talk
|
| 101 |
+
- **Mindfulness**: Present-moment awareness, meditation guidance, self-compassion
|
| 102 |
+
- **Grief Support**: Processing loss, coping with change
|
| 103 |
+
|
| 104 |
+
## π€ Contributing & Feedback
|
| 105 |
+
|
| 106 |
+
This model is part of ongoing research into AI applications for mental health support. If you have feedback or suggestions:
|
| 107 |
+
|
| 108 |
+
- **Model Issues**: Report on the [model repository](https://huggingface.co/phxdev/psychology-qwen-0.5b)
|
| 109 |
+
- **Interface Bugs**: Open an issue on this Space
|
| 110 |
+
- **Research Collaboration**: Contact [@phxdev](https://huggingface.co/phxdev)
|
| 111 |
+
|
| 112 |
+
## π Related Resources
|
| 113 |
+
|
| 114 |
+
- **Base Model**: [Qwen/Qwen2.5-0.5B](https://huggingface.co/Qwen/Qwen2.5-0.5B)
|
| 115 |
+
- **PEFT Library**: [huggingface/peft](https://github.com/huggingface/peft)
|
| 116 |
+
- **Mental Health Resources**: [National Alliance on Mental Illness](https://nami.org)
|
| 117 |
+
|
| 118 |
+
## π License
|
| 119 |
+
|
| 120 |
+
This Space and the fine-tuned model are released under the Apache 2.0 License. The base Qwen model follows its original licensing terms.
|
| 121 |
+
|
| 122 |
+
---
|
| 123 |
+
|
| 124 |
+
**Built with β€οΈ by [@phxdev](https://huggingface.co/phxdev) using Gradio and HuggingFace Transformers**
|