CoolFace
Modelpublic

TheCarBun/GPT-2-fine-tuned-mental-health

sourceHugging Faceapache-2.0updated 2y agoView on Hugging Face
4likes27downloads
Model Card

GPT-2 Fine-Tuned Mental Health Chatbot

![Hugging Face](https://huggingface.co/TheCarBun/GPT-2-fine-tuned-mental-health) ![License](https://opensource.org/licenses/Apache-2.0)

๐Ÿ“ Model Description

This is a fine-tuned GPT-2 model specialized for mental health support conversations. It provides empathetic responses to users feeling distressed, stressed, or anxious. This model is trained on a custom dataset with carefully crafted conversational data.

๐Ÿš€ Use case: AI-driven mental health support chatbot. ๐Ÿ›  Base Model: GPT-2 ๐Ÿ“ Dataset: Custom dataset based on intents.json + Kaggle conversational dataset


๐Ÿ“‚ Model Files

FileDescription
config.jsonModel configuration
pytorch_model.binModel weights
tokenizer.jsonTokenizer configuration
vocab.jsonVocabulary file
training_args.binTraining hyperparameters
generation_config.jsonGeneration settings

๐Ÿ—๏ธ Training Details

The model was fine-tuned on Google Colab using the Hugging Face Transformers library. Training was performed using:

  • โ€”Optimizer: AdamW
  • โ€”Learning Rate: 5e-5
  • โ€”Batch Size: 8
  • โ€”Epochs: 5

๐Ÿ“Š Training Performance

EpochTraining LossValidation Loss
11.19321.0248
20.75320.7870
30.75200.6927
40.60180.6580
50.51920.6403

๐Ÿš€ How to Use the Model

You can load and use the model with Hugging Face Transformers:

python
from transformers import pipeline

# Load the model
chatbot = pipeline("text-generation", model="TheCarBun/GPT-2-fine-tuned-mental-health")

# Test the chatbot
user_input = "I feel so alone."
response = chatbot(f"User: {user_input} AI:", max_length=50)
print(response[0]['generated_text'])

๐Ÿ“ Note: If running locally, install dependencies first:

bash
pip install transformers torch

๐Ÿ› ๏ธ Future Improvements

  • โ€”Expand dataset to cover more diverse mental health conversations
  • โ€”Improve response coherence by fine-tuning with reinforcement learning
  • โ€”Optimize model size for deployment on mobile devices

๐Ÿ“œ License

This model is licensed under the Apache 2.0 License. You are free to use, modify, and distribute it with proper attribution.

๐Ÿ“Œ Hugging Face Model Link: GPT-2 Fine-Tuned Mental Health


โœจ If you find this model useful, give it a star on Hugging Face! โญ