YAML Metadata
Warning:
The pipeline tag "conversational" is not in the official list: text-classification, token-classification, table-question-answering, question-answering, zero-shot-classification, translation, summarization, feature-extraction, text-generation, text2text-generation, fill-mask, sentence-similarity, text-to-speech, text-to-audio, automatic-speech-recognition, audio-to-audio, audio-classification, voice-activity-detection, depth-estimation, image-classification, object-detection, image-segmentation, text-to-image, image-to-text, image-to-image, image-to-video, unconditional-image-generation, video-classification, reinforcement-learning, robotics, tabular-classification, tabular-regression, tabular-to-text, table-to-text, multiple-choice, text-retrieval, time-series-forecasting, text-to-video, image-text-to-text, visual-question-answering, document-question-answering, zero-shot-image-classification, graph-ml, mask-generation, zero-shot-object-detection, text-to-3d, image-to-3d, image-feature-extraction, video-text-to-text, keypoint-detection, any-to-any, other
blenderbot-1B-distill fine-tuned on the ESConv dataset and AugESC dataset.
See the original paper for details.
Usage example:
import torch
from transformers import AutoTokenizer
from transformers.models.blenderbot import BlenderbotTokenizer, BlenderbotForConditionalGeneration
def _norm(x):
return ' '.join(x.strip().split())
tokenizer = BlenderbotTokenizer.from_pretrained('thu-coai/blenderbot-1B-augesc')
model = BlenderbotForConditionalGeneration.from_pretrained('thu-coai/blenderbot-1B-augesc')
model.eval()
utterances = [
"I am having a lot of anxiety about quitting my current job. It is too stressful but pays well",
"What makes your job stressful for you?",
"I have to deal with many people in hard financial situations and it is upsetting",
"Do you help your clients to make it to a better financial situation?",
"I do, but often they are not going to get back to what they want. Many people are going to lose their home when safeguards are lifted",
]
input_sequence = ' '.join([' ' + e for e in utterances]) + tokenizer.eos_token # add space prefix and separate utterances with two spaces
input_ids = tokenizer.convert_tokens_to_ids(tokenizer.tokenize(input_sequence))[-128:]
input_ids = torch.LongTensor([input_ids])
model_output = model.generate(input_ids, num_beams=1, do_sample=True, top_p=0.9, num_return_sequences=5, return_dict=False)
generation = tokenizer.batch_decode(model_output, skip_special_tokens=True)
generation = [_norm(e) for e in generation]
print(generation)
utterances.append(generation[0]) # for future loop
Please kindly cite our papers if you use this model:
@inproceedings{liu-etal-2021-towards,
title={Towards Emotional Support Dialog Systems},
author={Liu, Siyang and
Zheng, Chujie and
Demasi, Orianna and
Sabour, Sahand and
Li, Yu and
Yu, Zhou and
Jiang, Yong and
Huang, Minlie},
booktitle={ACL},
year={2021}
}
@inproceedings{zheng-etal-2023-augesc,
title={AugESC: Dialogue Augmentation with Large Language Models for Emotional Support Conversation},
author={Zheng, Chujie and
Sabour, Sahand and
Wen, Jiaxin and
Zhang, Zheng and
Huang, Minlie},
booktitle={Findings of ACL},
year={2023}
}
- Downloads last month
- 26
This model does not have enough activity to be deployed to Inference API (serverless) yet. Increase its social
visibility and check back later, or deploy to Inference Endpoints (dedicated)
instead.