Downloads · 30 days
19
2% of all-time downloads
wawaup/MengziT5-Comment
MengziT5-Comment is a machine learning model from wawaup. 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. The card lists the license as apache-2.0.
- 基于中文MengziT5的新闻评论生成模型 - 数据集来源于论文《Coherent Comment Generation for Chinese Articles with a Graph-to-Sequence Model》
Downloads · 30 days
19
2% of all-time downloads
All-time downloads
1.1K
Public
Repo size
9.9 GB
Likes
2
Public
Click a slice to open those files.
.pt2 GB · 67%
From the Hugging Face model README
t5_tokenizer = T5Tokenizer.from_pretrained("Langboat/mengzi-t5-base")
model = T5ForConditionalGeneration.from_pretrained("wawaup/MengziT5-Comment")
def generate_comment(input_ids,cnt_num):
outputs = model.generate(input_ids,
max_length=128,
do_sample=True,
temperature=0.9,
early_stopping=True,
repetition_penalty=10.0,
top_p=0.5,
num_return_sequences=cnt_num)
print(outputs)
preds_cleaned = [t5_tokenizer.decode(ids, skip_special_tokens=True,
clean_up_tokenization_spaces=True) for ids in outputs]
print(preds_cleaned)
return preds_cleaned