Downloads · 30 days
22
0% of all-time downloads
HIT-TMG/dialogue-bart-base-chinese
dialogue-bart-base-chinese is a machine learning model from HIT-TMG. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for transformers.
This is a seq2seq model fine-tuned on several Chinese dialogue datasets, from bart-base-chinese.
Downloads · 30 days
22
0% of all-time downloads
All-time downloads
7K
Public
Repo size
930 MB
Likes
7
Public
Click a slice to open those files.
.bin465 MB · 100%
From the Hugging Face model README
This is a seq2seq model fine-tuned on several Chinese dialogue datasets, from bart-base-chinese.
Now you can experience our model on HuggingFace Spaces HIT-TMG/dialogue-bart-large-chinese .
We utilize 4 Chinese dialogue datasets from LUGE
| Count | Domain | |
| Chinese Persona Chat (CPC) | 23,000 | Open |
| LCCC | 11,987,759 | Open |
| Emotional STC (ESTC) | 899,207 | Open |
| KdConv | 3,000 | Movie, Music, Travel |
Input: [CLS] 对话历史:<history> 知识:<knowledge> [SEP]
Output: [CLS] <response> [SEP]
from transformers import BertTokenizer, BartForConditionalGeneration
# Note that tokenizer is an object of BertTokenizer, instead of BartTokenizer
tokenizer = BertTokenizer.from_pretrained("HIT-TMG/dialogue-bart-base-chinese")
model = BartForConditionalGeneration.from_pretrained("HIT-TMG/dialogue-bart-base-chinese")
# an example from CPC dev data
history = ["可以 认识 一下 吗 ?", "当然 可以 啦 , 你好 。", "嘿嘿 你好 , 请问 你 最近 在 忙 什么 呢 ?", "我 最近 养 了 一只 狗狗 , 我 在 训练 它 呢 。"]
history_str = "对话历史:" + tokenizer.sep_token.join(history)
input_ids = tokenizer(history_str, return_tensors='pt').input_ids
output_ids = model.generate(input_ids)[0]
print(tokenizer.decode(output_ids, skip_special_tokens=True))
If you encounter any issue, feel free to contact us via the email: <u>[email protected]</u>