This model detects Interpretations - interpreting the seeker's situation or feelings in conversational responses, specifically designed for mental health support contexts.
Model Description
This is a BiEncoder model based on RoBERTa that classifies empathy levels in mental health support conversations. It uses a dual-encoder architecture with cross-attention:
Seeker Encoder: Processes the help-seeker's post (context)
Responder Encoder: Processes the response post with attention to the seeker's context
Multi-task Learning: Jointly predicts empathy level and identifies rationale tokens
Model Outputs
Empathy Level Classification (3 classes):
0: Low empathy
1: Medium empathy
2: High empathy
Rationale Identification: Binary classification for each token indicating whether it contributes to empathy expression
Intended Use
This model is designed for:
Analyzing empathy in mental health support conversations
Research on empathetic communication patterns
Building empathy-aware chatbots and support systems
Training and feedback for peer support volunteers
Training Data
Trained on Reddit mental health support conversations from subreddits focused on emotional support and mental health discussions.
How to Use
Installation
pip install transformers torch
Basic Usage
python
1from transformers import AutoModel, AutoTokenizer, AutoConfig
2import torch
34# Load model and tokenizer5model_name ="RyanDDD/empathy-mental-health-reddit-IP"6tokenizer = AutoTokenizer.from_pretrained(model_name)7config = AutoConfig.from_pretrained(model_name, trust_remote_code=True)8model = AutoModel.from_pretrained(model_name, trust_remote_code=True)910# Example conversation11seeker_post ="I've been feeling really down lately and don't know what to do."12response_post ="I'm sorry you're going through this. It's completely normal to feel this way sometimes. Have you considered talking to someone about how you're feeling?"1314# Tokenize15encoded_sp = tokenizer(16 seeker_post,17 max_length=64,18 padding='max_length',19 truncation=True,20 return_tensors='pt'21)22encoded_rp = tokenizer(23 response_post,24 max_length=64,25 padding='max_length',26 truncation=True,27 return_tensors='pt'28)2930# Predict31model.eval()32with torch.no_grad():33 outputs = model(34 input_ids_SP=encoded_sp['input_ids'],35 input_ids_RP=encoded_rp['input_ids'],36 attention_mask_SP=encoded_sp['attention_mask'],37 attention_mask_RP=encoded_rp['attention_mask']38)39 logits_empathy = outputs[0]40 logits_rationale = outputs[1]4142# Get predictions43empathy_level = torch.argmax(logits_empathy, dim=1).item()44empathy_labels =['Low','Medium','High']45print(f"Empathy Level (IP): {empathy_labels[empathy_level]}")