英文

language: en

license: apache-2.0

HF-version model for PRIMERA: Pyramid-based Masked Sentence Pre-training for Multi-document Summarization (ACL 2022).

The original code can be found here . You can find the script and notebook to train/evaluate the model in the original github repo.

  • Note: due to the difference between the implementations of the original Longformer and the Huggingface LED model, the results of converted models are slightly different. We run a sanity check on both fine-tuned and non fine-tuned models on the MultiNews dataset, and show the results below:

| Model | Rouge-1 | Rouge-2 | Rouge-L |

| --- | ----------- |----------- |----------- |

| PRIMERA | 42.0 | 13.6 | 20.8|

| PRIMERA-hf | 41.7 |13.6 | 20.5|

| PRIMERA(finetuned) | 49.9 | 21.1 | 25.9|

| PRIMERA-hf(finetuned) | 49.9 | 20.9 | 25.8|

You can use it by

from transformers import (

    AutoTokenizer,

    LEDConfig,

    LEDForConditionalGeneration,

)

tokenizer = AutoTokenizer.from_pretrained('allenai/PRIMERA')

config=LEDConfig.from_pretrained('allenai/PRIMERA')

model = LEDForConditionalGeneration.from_pretrained('allenai/PRIMERA')

语言:英语

许可证:apache-2.0

PRIMERA的HF版本模型:基于金字塔的用于多文档摘要的掩码句子预训练(ACL 2022)。

原始代码可在 here 处找到。您可以在原始的github存储库中找到用于训练/评估模型的脚本和笔记本。

  • 注意:由于原始Longformer和Huggingface LED模型之间实现的差异,转换模型的结果略有不同。我们在MultiNews数据集上对细调和非细调模型进行了合理性检查,并在下面显示了结果:

| 模型 | Rouge-1 | Rouge-2 | Rouge-L |

| --- | ----------- |----------- |----------- |

| PRIMERA | 42.0 | 13.6 | 20.8|

| PRIMERA-hf | 41.7 |13.6 | 20.5|

| PRIMERA(细调) | 49.9 | 21.1 | 25.9|

| PRIMERA-hf(细调) | 49.9 | 20.9 | 25.8|

您可以通过

from transformers import (

    AutoTokenizer,

    LEDConfig,

    LEDForConditionalGeneration,

)

tokenizer = AutoTokenizer.from_pretrained('allenai/PRIMERA')

config=LEDConfig.from_pretrained('allenai/PRIMERA')

model = LEDForConditionalGeneration.from_pretrained('allenai/PRIMERA')
进行使用