模型:
google/roberta2roberta_L-24_gigaword
该模型在 this paper 年由Sascha Rothe,Shashi Narayan,Aliaksei Severyn引入,并于 this repository 年首次发布。
该模型是一个编码器-解码器模型,其编码器和解码器都是在roberta-large的检查点上初始化的,并使用Gigaword数据集进行了标题生成的微调,该数据集在上面链接中可以找到。
免责声明:模型卡片由Hugging Face团队编写。
您可以将此模型用于极端摘要,例如
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM tokenizer = AutoTokenizer.from_pretrained("google/roberta2roberta_L-24_gigaword") model = AutoModelForSeq2SeqLM.from_pretrained("google/roberta2roberta_L-24_gigaword") article = """australian shares closed down #.# percent monday following a weak lead from the united states and lower commodity prices , dealers said .""" input_ids = tokenizer(article, return_tensors="pt").input_ids output_ids = model.generate(input_ids)[0] print(tokenizer.decode(output_ids, skip_special_tokens=True)) # should output # australian shares close down #.# percent.