Compare commits
10 Commits
78e492d5ce
...
cb48c1365b
Author | SHA1 | Date |
---|---|---|
|
cb48c1365b | |
|
030bb1bda8 | |
|
9e1698384a | |
|
76041a4d55 | |
|
22fa33834d | |
|
b51e601345 | |
|
f8275ef803 | |
|
6000698fa9 | |
|
b47d1df81e | |
|
f15be2839d |
|
@ -6,3 +6,4 @@
|
|||
*.tar.gz filter=lfs diff=lfs merge=lfs -text
|
||||
*.ot filter=lfs diff=lfs merge=lfs -text
|
||||
*.onnx filter=lfs diff=lfs merge=lfs -text
|
||||
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
||||
|
|
|
@ -0,0 +1,62 @@
|
|||
---
|
||||
license: apache-2.0
|
||||
language: en
|
||||
---
|
||||
|
||||
# BART (large-sized model)
|
||||
|
||||
BART model pre-trained on English language. It was introduced in the paper [BART: Denoising Sequence-to-Sequence Pre-training for Natural Language Generation, Translation, and Comprehension](https://arxiv.org/abs/1910.13461) by Lewis et al. and first released in [this repository](https://github.com/pytorch/fairseq/tree/master/examples/bart).
|
||||
|
||||
Disclaimer: The team releasing BART did not write a model card for this model so this model card has been written by the Hugging Face team.
|
||||
|
||||
## Model description
|
||||
|
||||
BART is a transformer encoder-decoder (seq2seq) model with a bidirectional (BERT-like) encoder and an autoregressive (GPT-like) decoder. BART is pre-trained by (1) corrupting text with an arbitrary noising function, and (2) learning a model to reconstruct the original text.
|
||||
|
||||
BART is particularly effective when fine-tuned for text generation (e.g. summarization, translation) but also works well for comprehension tasks (e.g. text classification, question answering).
|
||||
|
||||
## Intended uses & limitations
|
||||
|
||||
You can use the raw model for text infilling. However, the model is mostly meant to be fine-tuned on a supervised dataset. See the [model hub](https://huggingface.co/models?search=bart) to look for fine-tuned versions on a task that interests you.
|
||||
|
||||
### How to use
|
||||
|
||||
Here is how to use this model in PyTorch:
|
||||
|
||||
```python
|
||||
from transformers import BartTokenizer, BartModel
|
||||
|
||||
tokenizer = BartTokenizer.from_pretrained('facebook/bart-large')
|
||||
model = BartModel.from_pretrained('facebook/bart-large')
|
||||
|
||||
inputs = tokenizer("Hello, my dog is cute", return_tensors="pt")
|
||||
outputs = model(**inputs)
|
||||
|
||||
last_hidden_states = outputs.last_hidden_state
|
||||
```
|
||||
|
||||
### BibTeX entry and citation info
|
||||
|
||||
```bibtex
|
||||
@article{DBLP:journals/corr/abs-1910-13461,
|
||||
author = {Mike Lewis and
|
||||
Yinhan Liu and
|
||||
Naman Goyal and
|
||||
Marjan Ghazvininejad and
|
||||
Abdelrahman Mohamed and
|
||||
Omer Levy and
|
||||
Veselin Stoyanov and
|
||||
Luke Zettlemoyer},
|
||||
title = {{BART:} Denoising Sequence-to-Sequence Pre-training for Natural Language
|
||||
Generation, Translation, and Comprehension},
|
||||
journal = {CoRR},
|
||||
volume = {abs/1910.13461},
|
||||
year = {2019},
|
||||
url = {http://arxiv.org/abs/1910.13461},
|
||||
eprinttype = {arXiv},
|
||||
eprint = {1910.13461},
|
||||
timestamp = {Thu, 31 Oct 2019 14:02:26 +0100},
|
||||
biburl = {https://dblp.org/rec/journals/corr/abs-1910-13461.bib},
|
||||
bibsource = {dblp computer science bibliography, https://dblp.org}
|
||||
}
|
||||
```
|
37
config.json
37
config.json
|
@ -1,16 +1,15 @@
|
|||
{
|
||||
"_num_labels": 3,
|
||||
"activation_dropout": 0.0,
|
||||
"activation_dropout": 0.1,
|
||||
"activation_function": "gelu",
|
||||
"add_bias_logits": false,
|
||||
"add_final_layer_norm": false,
|
||||
"architectures": [
|
||||
"BartModel",
|
||||
"BartForMaskedLM",
|
||||
"BartForSequenceClassification"
|
||||
"BartModel"
|
||||
],
|
||||
"attention_dropout": 0.0,
|
||||
"attention_dropout": 0.1,
|
||||
"bos_token_id": 0,
|
||||
"classif_dropout": 0.0,
|
||||
"classif_dropout": 0.1,
|
||||
"classifier_dropout": 0.0,
|
||||
"d_model": 1024,
|
||||
"decoder_attention_heads": 16,
|
||||
"decoder_ffn_dim": 4096,
|
||||
|
@ -18,11 +17,15 @@
|
|||
"decoder_layers": 12,
|
||||
"decoder_start_token_id": 2,
|
||||
"dropout": 0.1,
|
||||
"early_stopping": true,
|
||||
"encoder_attention_heads": 16,
|
||||
"encoder_ffn_dim": 4096,
|
||||
"encoder_layerdrop": 0.0,
|
||||
"encoder_layers": 12,
|
||||
"eos_token_id": 2,
|
||||
"forced_eos_token_id": 2,
|
||||
"forced_bos_token_id": 0,
|
||||
"gradient_checkpointing": false,
|
||||
"id2label": {
|
||||
"0": "LABEL_0",
|
||||
"1": "LABEL_1",
|
||||
|
@ -37,21 +40,33 @@
|
|||
},
|
||||
"max_position_embeddings": 1024,
|
||||
"model_type": "bart",
|
||||
"no_repeat_ngram_size": 3,
|
||||
"normalize_before": false,
|
||||
"num_beams": 4,
|
||||
"num_hidden_layers": 12,
|
||||
"output_past": false,
|
||||
"pad_token_id": 1,
|
||||
"prefix": " ",
|
||||
"scale_embedding": false,
|
||||
"task_specific_params": {
|
||||
"summarization": {
|
||||
"early_stopping": true,
|
||||
"length_penalty": 1.0,
|
||||
"max_length": 128,
|
||||
"min_length": 12,
|
||||
"num_beams": 4
|
||||
},
|
||||
"summarization_cnn": {
|
||||
"length_penalty": 2.0,
|
||||
"max_length": 142,
|
||||
"min_length": 56,
|
||||
"no_repeat_ngram_size": 3,
|
||||
"num_beams": 4
|
||||
},
|
||||
"summarization_xsum": {
|
||||
"length_penalty": 1.0,
|
||||
"max_length": 62,
|
||||
"min_length": 11,
|
||||
"num_beams": 6
|
||||
}
|
||||
},
|
||||
"transformers_version": "4.7.0.dev0",
|
||||
"use_cache": true,
|
||||
"vocab_size": 50265
|
||||
}
|
||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
|
@ -0,0 +1 @@
|
|||
{"model_max_length": 1024}
|
Loading…
Reference in New Issue