Downloads · 30 days
87.5K
7% of all-time downloads
microsoft/prophetnet-large-uncased
prophetnet-large-uncased is a machine learning model from microsoft. 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.
Pretrained weights for ProphetNet. ProphetNet is a new pre-trained language model for sequence-to-sequence learning with a novel self-supervised objective called future n-gram prediction. ProphetNet is able to predict…
Downloads · 30 days
87.5K
7% of all-time downloads
All-time downloads
1.2M
Public
Parameters
391M
5.1 GB on disk
Likes
6
Public
Click a slice to open those files.
.ot1.9 GB · 38%
From the Hugging Face model README
Pretrained weights for ProphetNet.
ProphetNet is a new pre-trained language model for sequence-to-sequence learning with a novel self-supervised objective called future n-gram prediction.
ProphetNet is able to predict more future tokens with a n-stream decoder. The original implementation is Fairseq version at github repo.
This pre-trained model can be fine-tuned on sequence-to-sequence tasks. The model could e.g. be trained on headline generation as follows:
from transformers import ProphetNetForConditionalGeneration, ProphetNetTokenizer
model = ProphetNetForConditionalGeneration.from_pretrained("microsoft/prophetnet-large-uncased")
tokenizer = ProphetNetTokenizer.from_pretrained("microsoft/prophetnet-large-uncased")
input_str = "the us state department said wednesday it had received no formal word from bolivia that it was expelling the us ambassador there but said the charges made against him are `` baseless ."
target_str = "us rejects charges against its ambassador in bolivia"
input_ids = tokenizer(input_str, return_tensors="pt").input_ids
labels = tokenizer(target_str, return_tensors="pt").input_ids
loss = model(input_ids, labels=labels).loss
@article{yan2020prophetnet,
title={Prophetnet: Predicting future n-gram for sequence-to-sequence pre-training},
author={Yan, Yu and Qi, Weizhen and Gong, Yeyun and Liu, Dayiheng and Duan, Nan and Chen, Jiusheng and Zhang, Ruofei and Zhou, Ming},
journal={arXiv preprint arXiv:2001.04063},
year={2020}
}