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
.
Usage
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
Citation
@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}
}
Runs of microsoft prophetnet-large-uncased on huggingface.co
93.6K
Total runs
0
24-hour runs
379
3-day runs
-9.3K
7-day runs
-45.4K
30-day runs
More Information About prophetnet-large-uncased huggingface.co Model
prophetnet-large-uncased huggingface.co
prophetnet-large-uncased huggingface.co is an AI model on huggingface.co that provides prophetnet-large-uncased's model effect (), which can be used instantly with this microsoft prophetnet-large-uncased model. huggingface.co supports a free trial of the prophetnet-large-uncased model, and also provides paid use of the prophetnet-large-uncased. Support call prophetnet-large-uncased model through api, including Node.js, Python, http.
prophetnet-large-uncased huggingface.co is an online trial and call api platform, which integrates prophetnet-large-uncased's modeling effects, including api services, and provides a free online trial of prophetnet-large-uncased, you can try prophetnet-large-uncased online for free by clicking the link below.
microsoft prophetnet-large-uncased online free url in huggingface.co:
prophetnet-large-uncased is an open source model from GitHub that offers a free installation service, and any user can find prophetnet-large-uncased on GitHub to install. At the same time, huggingface.co provides the effect of prophetnet-large-uncased install, users can directly use prophetnet-large-uncased installed effect in huggingface.co for debugging and trial. It also supports api for free installation.
prophetnet-large-uncased install url in huggingface.co: