obx0x3/empathy-dementia
Viewer • Updated • 170 • 13 • 1
A fine‑tuned multilingual T5‑Base model for empathetic responses designed for individuals with dementia.
"en") and French ("fr"){
"input": "Where are my glasses?",
"target": "Let’s look together. Maybe near your chair.",
"lang": "en"
}
| Epoch | Training Loss | Validation Loss |
|---|---|---|
| 1 | 0.191100 | 0.101121 |
| 2 | 0.119100 | 0.061524 |
| 3 | 0.103100 | 0.042741 |
| 4 | 0.079900 | 0.038426 |
from transformers import T5Tokenizer, T5ForConditionalGeneration
model = T5ForConditionalGeneration.from_pretrained("obx0x3/empathy-dementia")
tokenizer = T5Tokenizer.from_pretrained("obx0x3/empathy-dementia")
def empathetic_response(prompt, lang="en"):
prefix = "emotion: " if lang == "en" else "émotion: "
input_ids = tokenizer(prefix + prompt, return_tensors="pt").input_ids
output_ids = model.generate(input_ids, max_length=50)
return tokenizer.decode(output_ids[0], skip_special_tokens=True)
print(empathetic_response("I feel so lonely.", lang="en"))
print(empathetic_response("Je me sens seul.", lang="fr"))
MSc Dissertion Proof of concept and work for primary use case: Aid communication with individuals experiencing memory loss, confusion, or distress
NOT for clinical decisions — designed as a supportive tool