Views
No views yet
t5-small fine-tuned for empathetic response generation
Repository: https://huggingface.co/mcgowee/empathetic-t5
License: Apache-2.0t5-small, fine-tuned to generate contextually appropriate empathetic replies given user input and an emotion label. fileciteturn1file2empathetic_dialogues_v2 from Hugging Face (Adapting et al., 2023) fileciteturn1file2chat_history: user utterances split into individual promptsemotion: emotion label associated with each promptsystem_response: the coach-like empathetic replyt5-small (Text-to-Text Transfer Transformer) fileciteturn1file2train_t5.pynum_train_epochs: 3eval_strategy: "epoch"transformersnumpysplit_chat_into_pairs to break down multi-turn dialogues into (input, response) pairs1from transformers import AutoTokenizer, AutoModelForSeq2SeqLM, pipeline
2
3tokenizer = AutoTokenizer.from_pretrained("mcgowee/empathetic-t5")
4model = AutoModelForSeq2SeqLM.from_pretrained("mcgowee/empathetic-t5")
5empathic_pipeline = pipeline(
6 "text2text-generation",
7 model=model,
8 tokenizer=tokenizer,
9 device=0 # use -1 for CPU
10)
11
12prompt = "I just had a terrible day and nobody seems to care."
13response = empathic_pipeline(prompt, max_length=64)
14print(response[0]['generated_text'])1@misc{mcgowee_empathetic-t5_2025,
2 title = {Empathetic-T5: T5 Model Fine-Tuned for Empathetic Response Generation},
3 author = {Earl McGowen (mcgowee)},
4 year = {2025},
5 howpublished = {\\url{https://huggingface.co/mcgowee/empathetic-t5}}
6}