Upload 6 files
Browse files- README.md +74 -0
- config.json +124 -0
- special_tokens_map.json +1 -0
- spiece.model +3 -0
- tokenizer.json +0 -0
- tokenizer_config.json +1 -0
README.md
ADDED
@@ -0,0 +1,74 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
language: en
|
3 |
+
tags:
|
4 |
+
- summarization
|
5 |
+
---
|
6 |
+
|
7 |
+
### Pegasus Models
|
8 |
+
See Docs: [here](https://huggingface.co/transformers/master/model_doc/pegasus.html)
|
9 |
+
|
10 |
+
Original TF 1 code [here](https://github.com/google-research/pegasus)
|
11 |
+
|
12 |
+
Authors: Jingqing Zhang, Yao Zhao, Mohammad Saleh and Peter J. Liu on Dec 18, 2019
|
13 |
+
|
14 |
+
Maintained by: [@sshleifer](https://twitter.com/sam_shleifer)
|
15 |
+
|
16 |
+
Task: Summarization
|
17 |
+
|
18 |
+
The following is copied from the authors' README.
|
19 |
+
|
20 |
+
# Mixed & Stochastic Checkpoints
|
21 |
+
|
22 |
+
We train a pegasus model with sampled gap sentence ratios on both C4 and HugeNews, and stochastically sample important sentences. The updated the results are reported in this table.
|
23 |
+
|
24 |
+
| dataset | C4 | HugeNews | Mixed & Stochastic|
|
25 |
+
| ---- | ---- | ---- | ----|
|
26 |
+
| xsum | 45.20/22.06/36.99 | 47.21/24.56/39.25 | 47.60/24.83/39.64|
|
27 |
+
| cnn_dailymail | 43.90/21.20/40.76 | 44.17/21.47/41.11 | 44.16/21.56/41.30|
|
28 |
+
| newsroom | 45.07/33.39/41.28 | 45.15/33.51/41.33 | 45.98/34.20/42.18|
|
29 |
+
| multi_news | 46.74/17.95/24.26 | 47.52/18.72/24.91 | 47.65/18.75/24.95|
|
30 |
+
| gigaword | 38.75/19.96/36.14 | 39.12/19.86/36.24 | 39.65/20.47/36.76|
|
31 |
+
| wikihow | 43.07/19.70/34.79 | 41.35/18.51/33.42 | 46.39/22.12/38.41 *|
|
32 |
+
| reddit_tifu | 26.54/8.94/21.64 | 26.63/9.01/21.60 | 27.99/9.81/22.94|
|
33 |
+
| big_patent | 53.63/33.16/42.25 | 53.41/32.89/42.07 | 52.29/33.08/41.66 *|
|
34 |
+
| arxiv | 44.70/17.27/25.80 | 44.67/17.18/25.73 | 44.21/16.95/25.67|
|
35 |
+
| pubmed | 45.49/19.90/27.69 | 45.09/19.56/27.42 | 45.97/20.15/28.25|
|
36 |
+
| aeslc | 37.69/21.85/36.84 | 37.40/21.22/36.45 | 37.68/21.25/36.51|
|
37 |
+
| billsum | 57.20/39.56/45.80 | 57.31/40.19/45.82 | 59.67/41.58/47.59|
|
38 |
+
|
39 |
+
The "Mixed & Stochastic" model has the following changes:
|
40 |
+
- trained on both C4 and HugeNews (dataset mixture is weighted by their number of examples).
|
41 |
+
- trained for 1.5M instead of 500k (we observe slower convergence on pretraining perplexity).
|
42 |
+
- the model uniformly sample a gap sentence ratio between 15% and 45%.
|
43 |
+
- importance sentences are sampled using a 20% uniform noise to importance scores.
|
44 |
+
- the sentencepiece tokenizer is updated to be able to encode newline character.
|
45 |
+
|
46 |
+
|
47 |
+
(*) the numbers of wikihow and big_patent datasets are not comparable because of change in tokenization and data:
|
48 |
+
- wikihow dataset contains newline characters which is useful for paragraph segmentation, the C4 and HugeNews model's sentencepiece tokenizer doesn't encode newline and loose this information.
|
49 |
+
- we update the BigPatent dataset to preserve casing, some format cleanings are also changed, please refer to change in TFDS.
|
50 |
+
|
51 |
+
|
52 |
+
The "Mixed & Stochastic" model has the following changes (from pegasus-large in the paper):
|
53 |
+
|
54 |
+
|
55 |
+
trained on both C4 and HugeNews (dataset mixture is weighted by their number of examples).
|
56 |
+
trained for 1.5M instead of 500k (we observe slower convergence on pretraining perplexity).
|
57 |
+
the model uniformly sample a gap sentence ratio between 15% and 45%.
|
58 |
+
importance sentences are sampled using a 20% uniform noise to importance scores.
|
59 |
+
the sentencepiece tokenizer is updated to be able to encode newline character.
|
60 |
+
|
61 |
+
|
62 |
+
Citation
|
63 |
+
```
|
64 |
+
|
65 |
+
|
66 |
+
@misc{zhang2019pegasus,
|
67 |
+
title={PEGASUS: Pre-training with Extracted Gap-sentences for Abstractive Summarization},
|
68 |
+
author={Jingqing Zhang and Yao Zhao and Mohammad Saleh and Peter J. Liu},
|
69 |
+
year={2019},
|
70 |
+
eprint={1912.08777},
|
71 |
+
archivePrefix={arXiv},
|
72 |
+
primaryClass={cs.CL}
|
73 |
+
}
|
74 |
+
```
|
config.json
ADDED
@@ -0,0 +1,124 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_name_or_path": "../output_dir/",
|
3 |
+
"activation_dropout": 0.1,
|
4 |
+
"activation_function": "relu",
|
5 |
+
"add_bias_logits": false,
|
6 |
+
"add_final_layer_norm": true,
|
7 |
+
"architectures": [
|
8 |
+
"PegasusModel"
|
9 |
+
],
|
10 |
+
"attention_dropout": 0.1,
|
11 |
+
"bos_token_id": 0,
|
12 |
+
"classif_dropout": 0.0,
|
13 |
+
"classifier_dropout": 0.0,
|
14 |
+
"d_model": 1024,
|
15 |
+
"decoder_attention_heads": 16,
|
16 |
+
"decoder_ffn_dim": 4096,
|
17 |
+
"decoder_layerdrop": 0.0,
|
18 |
+
"decoder_layers": 16,
|
19 |
+
"decoder_start_token_id": 0,
|
20 |
+
"dropout": 0.1,
|
21 |
+
"encoder_attention_heads": 16,
|
22 |
+
"encoder_ffn_dim": 4096,
|
23 |
+
"encoder_layerdrop": 0.0,
|
24 |
+
"encoder_layers": 16,
|
25 |
+
"eos_token_id": 1,
|
26 |
+
"extra_pos_embeddings": 1,
|
27 |
+
"force_bos_token_to_be_generated": false,
|
28 |
+
"forced_eos_token_id": 1,
|
29 |
+
"gradient_checkpointing": false,
|
30 |
+
"id2label": {
|
31 |
+
"0": "LABEL_0",
|
32 |
+
"1": "LABEL_1",
|
33 |
+
"2": "LABEL_2"
|
34 |
+
},
|
35 |
+
"init_std": 0.02,
|
36 |
+
"is_encoder_decoder": true,
|
37 |
+
"label2id": {
|
38 |
+
"LABEL_0": 0,
|
39 |
+
"LABEL_1": 1,
|
40 |
+
"LABEL_2": 2
|
41 |
+
},
|
42 |
+
"length_penalty": 0.8,
|
43 |
+
"max_length": 256,
|
44 |
+
"max_position_embeddings": 1024,
|
45 |
+
"model_type": "pegasus",
|
46 |
+
"normalize_before": true,
|
47 |
+
"normalize_embedding": false,
|
48 |
+
"num_beams": 8,
|
49 |
+
"num_hidden_layers": 16,
|
50 |
+
"pad_token_id": 0,
|
51 |
+
"scale_embedding": true,
|
52 |
+
"static_position_embeddings": true,
|
53 |
+
"task_specific_params": {
|
54 |
+
"summarization_aeslc": {
|
55 |
+
"length_penalty": 0.6,
|
56 |
+
"max_length": 32,
|
57 |
+
"max_position_embeddings": 512
|
58 |
+
},
|
59 |
+
"summarization_arxiv": {
|
60 |
+
"length_penalty": 0.8,
|
61 |
+
"max_length": 256,
|
62 |
+
"max_position_embeddings": 1024
|
63 |
+
},
|
64 |
+
"summarization_big_patent": {
|
65 |
+
"length_penalty": 0.7,
|
66 |
+
"max_length": 256,
|
67 |
+
"max_position_embeddings": 1024
|
68 |
+
},
|
69 |
+
"summarization_billsum": {
|
70 |
+
"length_penalty": 0.6,
|
71 |
+
"max_length": 256,
|
72 |
+
"max_position_embeddings": 1024
|
73 |
+
},
|
74 |
+
"summarization_cnn_dailymail": {
|
75 |
+
"length_penalty": 0.8,
|
76 |
+
"max_length": 128,
|
77 |
+
"max_position_embeddings": 1024
|
78 |
+
},
|
79 |
+
"summarization_gigaword": {
|
80 |
+
"length_penalty": 0.6,
|
81 |
+
"max_length": 32,
|
82 |
+
"max_position_embeddings": 128
|
83 |
+
},
|
84 |
+
"summarization_large": {
|
85 |
+
"length_penalty": 0.8,
|
86 |
+
"max_length": 256,
|
87 |
+
"max_position_embeddings": 1024
|
88 |
+
},
|
89 |
+
"summarization_multi_news": {
|
90 |
+
"length_penalty": 0.8,
|
91 |
+
"max_length": 256,
|
92 |
+
"max_position_embeddings": 1024
|
93 |
+
},
|
94 |
+
"summarization_newsroom": {
|
95 |
+
"length_penalty": 0.8,
|
96 |
+
"max_length": 128,
|
97 |
+
"max_position_embeddings": 512
|
98 |
+
},
|
99 |
+
"summarization_pubmed": {
|
100 |
+
"length_penalty": 0.8,
|
101 |
+
"max_length": 256,
|
102 |
+
"max_position_embeddings": 1024
|
103 |
+
},
|
104 |
+
"summarization_reddit_tifu": {
|
105 |
+
"length_penalty": 0.6,
|
106 |
+
"max_length": 128,
|
107 |
+
"max_position_embeddings": 512
|
108 |
+
},
|
109 |
+
"summarization_wikihow": {
|
110 |
+
"length_penalty": 0.6,
|
111 |
+
"max_length": 256,
|
112 |
+
"max_position_embeddings": 512
|
113 |
+
},
|
114 |
+
"summarization_xsum": {
|
115 |
+
"length_penalty": 0.8,
|
116 |
+
"max_length": 64,
|
117 |
+
"max_position_embeddings": 512
|
118 |
+
}
|
119 |
+
},
|
120 |
+
"torch_dtype": "float32",
|
121 |
+
"transformers_version": "4.16.0.dev0",
|
122 |
+
"use_cache": true,
|
123 |
+
"vocab_size": 96103
|
124 |
+
}
|
special_tokens_map.json
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{"eos_token": "</s>", "unk_token": "<unk>", "pad_token": "<pad>", "mask_token": "<mask_2>", "additional_special_tokens": ["<mask_1>", "<unk_2>", "<unk_3>", "<unk_4>", "<unk_5>", "<unk_6>", "<unk_7>", "<unk_8>", "<unk_9>", "<unk_10>", "<unk_11>", "<unk_12>", "<unk_13>", "<unk_14>", "<unk_15>", "<unk_16>", "<unk_17>", "<unk_18>", "<unk_19>", "<unk_20>", "<unk_21>", "<unk_22>", "<unk_23>", "<unk_24>", "<unk_25>", "<unk_26>", "<unk_27>", "<unk_28>", "<unk_29>", "<unk_30>", "<unk_31>", "<unk_32>", "<unk_33>", "<unk_34>", "<unk_35>", "<unk_36>", "<unk_37>", "<unk_38>", "<unk_39>", "<unk_40>", "<unk_41>", "<unk_42>", "<unk_43>", "<unk_44>", "<unk_45>", "<unk_46>", "<unk_47>", "<unk_48>", "<unk_49>", "<unk_50>", "<unk_51>", "<unk_52>", "<unk_53>", "<unk_54>", "<unk_55>", "<unk_56>", "<unk_57>", "<unk_58>", "<unk_59>", "<unk_60>", "<unk_61>", "<unk_62>", "<unk_63>", "<unk_64>", "<unk_65>", "<unk_66>", "<unk_67>", "<unk_68>", "<unk_69>", "<unk_70>", "<unk_71>", "<unk_72>", "<unk_73>", "<unk_74>", "<unk_75>", "<unk_76>", "<unk_77>", "<unk_78>", "<unk_79>", "<unk_80>", "<unk_81>", "<unk_82>", "<unk_83>", "<unk_84>", "<unk_85>", "<unk_86>", "<unk_87>", "<unk_88>", "<unk_89>", "<unk_90>", "<unk_91>", "<unk_92>", "<unk_93>", "<unk_94>", "<unk_95>", "<unk_96>", "<unk_97>", "<unk_98>", "<unk_99>", "<unk_100>", "<unk_101>", "<unk_102>"]}
|
spiece.model
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:0015189ef36359283fec8b93cf6d9ce51bca37eb1101defc68a53b394913b96c
|
3 |
+
size 1912529
|
tokenizer.json
ADDED
The diff for this file is too large to render.
See raw diff
|
|
tokenizer_config.json
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{"pad_token": "<pad>", "eos_token": "</s>", "unk_token": "<unk>", "mask_token": "<mask_2>", "mask_token_sent": "<mask_1>", "offset": 103, "additional_special_tokens": ["<mask_1>", "<unk_2>", "<unk_3>", "<unk_4>", "<unk_5>", "<unk_6>", "<unk_7>", "<unk_8>", "<unk_9>", "<unk_10>", "<unk_11>", "<unk_12>", "<unk_13>", "<unk_14>", "<unk_15>", "<unk_16>", "<unk_17>", "<unk_18>", "<unk_19>", "<unk_20>", "<unk_21>", "<unk_22>", "<unk_23>", "<unk_24>", "<unk_25>", "<unk_26>", "<unk_27>", "<unk_28>", "<unk_29>", "<unk_30>", "<unk_31>", "<unk_32>", "<unk_33>", "<unk_34>", "<unk_35>", "<unk_36>", "<unk_37>", "<unk_38>", "<unk_39>", "<unk_40>", "<unk_41>", "<unk_42>", "<unk_43>", "<unk_44>", "<unk_45>", "<unk_46>", "<unk_47>", "<unk_48>", "<unk_49>", "<unk_50>", "<unk_51>", "<unk_52>", "<unk_53>", "<unk_54>", "<unk_55>", "<unk_56>", "<unk_57>", "<unk_58>", "<unk_59>", "<unk_60>", "<unk_61>", "<unk_62>", "<unk_63>", "<unk_64>", "<unk_65>", "<unk_66>", "<unk_67>", "<unk_68>", "<unk_69>", "<unk_70>", "<unk_71>", "<unk_72>", "<unk_73>", "<unk_74>", "<unk_75>", "<unk_76>", "<unk_77>", "<unk_78>", "<unk_79>", "<unk_80>", "<unk_81>", "<unk_82>", "<unk_83>", "<unk_84>", "<unk_85>", "<unk_86>", "<unk_87>", "<unk_88>", "<unk_89>", "<unk_90>", "<unk_91>", "<unk_92>", "<unk_93>", "<unk_94>", "<unk_95>", "<unk_96>", "<unk_97>", "<unk_98>", "<unk_99>", "<unk_100>", "<unk_101>", "<unk_102>"], "model_max_length": 1024, "special_tokens_map_file": null, "full_tokenizer_file": null, "name_or_path": "../output_dir/", "sp_model_kwargs": {}, "tokenizer_class": "PegasusTokenizer"}
|