yunfan commited on
Commit
06fa562
1 Parent(s): b47be24

update model to version 2.0

Browse files
README.md CHANGED
@@ -5,9 +5,38 @@ tags:
5
  - seq2seq
6
  language: zh
7
  ---
8
-
9
  # Chinese BART-Large
10
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11
  ## Model description
12
 
13
  This is an implementation of Chinese BART-Large.
@@ -18,7 +47,6 @@ Yunfan Shao, Zhichao Geng, Yitao Liu, Junqi Dai, Fei Yang, Li Zhe, Hujun Bao, Xi
18
 
19
  **Github Link:** https://github.com/fastnlp/CPT
20
 
21
-
22
  ## Usage
23
 
24
  ```python
@@ -42,4 +70,3 @@ Yunfan Shao, Zhichao Geng, Yitao Liu, Junqi Dai, Fei Yang, Li Zhe, Hujun Bao, Xi
42
  year={2021}
43
  }
44
  ```
45
-
 
5
  - seq2seq
6
  language: zh
7
  ---
 
8
  # Chinese BART-Large
9
 
10
+ ### News
11
+
12
+ **12/30/2022**
13
+
14
+ An updated version of CPT & Chinese BART are released. In the new version, we changed the following parts:
15
+
16
+ - **Vocabulary** We replace the old BERT vocabulary with a larger one of size 51271 built from the training data, in which we 1) add missing 6800+ Chinese characters (most of them are traditional Chinese characters); 2) remove redundant tokens (e.g. Chinese character tokens with ## prefix); 3) add some English tokens to reduce OOV.
17
+ - **Position Embeddings** We extend the max_position_embeddings from 512 to 1024.
18
+
19
+ We initialize the new version of models with the old version of checkpoints with vocabulary alignment. Token embeddings found in the old checkpoints are copied. And other newly added parameters are randomly initialized. We further train the new CPT & Chinese BART 50K steps with batch size 2048, max-seq-length 1024, peak learning rate 2e-5, and warmup ratio 0.1.
20
+
21
+ The result compared to the previous checkpoints is as followings:
22
+
23
+ | | AFQMC | IFLYTEK | CSL-sum | LCSTS | AVG |
24
+ | :--------- | :---: | :-----: | :-----: | :---: | :---: |
25
+ | Previous | | | | | |
26
+ | bart-base | 73.0 | 60 | 62.1 | 37.8 | 58.23 |
27
+ | cpt-base | 75.1 | 60.5 | 63.0 | 38.2 | 59.20 |
28
+ | bart-large | 75.7 | 62.1 | 64.2 | 40.6 | 60.65 |
29
+ | cpt-large | 75.9 | 61.8 | 63.7 | 42.0 | 60.85 |
30
+ | Updataed | | | | | |
31
+ | bart-base | 73.03 | 61.25 | 61.51 | 38.78 | 58.64 |
32
+ | cpt-base | 74.40 | 61.23 | 62.09 | 38.81 | 59.13 |
33
+ | bart-large | 75.81 | 61.52 | 64.62 | 40.90 | 60.71 |
34
+ | cpt-large | 75.97 | 61.63 | 63.83 | 42.08 | 60.88 |
35
+
36
+ The result shows that the updated models maintain comparative performance compared with previous checkpoints. There are still some cases that the updated model is slightly worse than the previous one, which results from the following reasons: 1) Training additional a few steps did not lead to significant performance improvement; 2) some downstream tasks are not affected by the newly added tokens and longer encoding sequences, but sensitive to the fine-tuning hyperparameters.
37
+
38
+ - Note that to use updated models, please update the `modeling_cpt.py` (new version download [Here](https://github.com/fastnlp/CPT/blob/master/finetune/modeling_cpt.py)) and the vocabulary (refresh the cache).
39
+
40
  ## Model description
41
 
42
  This is an implementation of Chinese BART-Large.
 
47
 
48
  **Github Link:** https://github.com/fastnlp/CPT
49
 
 
50
  ## Usage
51
 
52
  ```python
 
70
  year={2021}
71
  }
72
  ```
 
config.json CHANGED
@@ -4,7 +4,7 @@
4
  "add_bias_logits": false,
5
  "add_final_layer_norm": false,
6
  "architectures": [
7
- "BartModel"
8
  ],
9
  "attention_dropout": 0.1,
10
  "bos_token_id": 101,
@@ -37,7 +37,7 @@
37
  "LABEL_1": 1,
38
  "LABEL_2": 2
39
  },
40
- "max_position_embeddings": 512,
41
  "model_type": "bart",
42
  "no_repeat_ngram_size": 3,
43
  "normalize_before": false,
@@ -68,5 +68,6 @@
68
  },
69
  "transformers_version": "4.4.1",
70
  "use_cache": true,
71
- "vocab_size": 21128
 
72
  }
 
4
  "add_bias_logits": false,
5
  "add_final_layer_norm": false,
6
  "architectures": [
7
+ "BartForConditionalGeneration"
8
  ],
9
  "attention_dropout": 0.1,
10
  "bos_token_id": 101,
 
37
  "LABEL_1": 1,
38
  "LABEL_2": 2
39
  },
40
+ "max_position_embeddings": 1024,
41
  "model_type": "bart",
42
  "no_repeat_ngram_size": 3,
43
  "normalize_before": false,
 
68
  },
69
  "transformers_version": "4.4.1",
70
  "use_cache": true,
71
+ "tokenizer_class": "BertTokenizer",
72
+ "vocab_size": 51271
73
  }
pytorch_model.bin CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:585bc03582337332506a310bc4e68cdde844e280c6042795b44831a2164e1a33
3
- size 1679073976
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4b89e56ca2bb54b783a51984cfe17011b12e20d63eacd0221d4a730c48a5bd8c
3
+ size 1629686831
special_tokens_map.json CHANGED
@@ -1 +1 @@
1
- {"unk_token": "[UNK]", "sep_token": "[SEP]", "pad_token": "[PAD]", "cls_token": "[CLS]", "mask_token": "[MASK]"}
 
1
+ {"bos_token": "[CLS]", "eos_token": "[EOS]", "unk_token": "[UNK]", "sep_token": "[SEP]", "pad_token": "[PAD]", "cls_token": "[CLS]", "mask_token": "[MASK]"}
tokenizer_config.json CHANGED
@@ -1 +1 @@
1
- {"do_lower_case": true, "unk_token": "[UNK]", "sep_token": "[SEP]", "pad_token": "[PAD]", "cls_token": "[CLS]", "mask_token": "[MASK]", "tokenize_chinese_chars": true, "strip_accents": null, "special_tokens_map_file": "/remote-home/yfshao/.cache/huggingface/transformers/d521373fc7ac35f63d56cf303de74a202403dcf1aaa792cd01f653694be59563.dd8bd9bfd3664b530ea4e645105f557769387b3da9f79bdb55ed556bdd80611d", "name_or_path": "hfl/chinese-roberta-wwm-ext"}
 
1
+ {"do_lower_case": false, "do_basic_tokenize": true, "never_split": null, "unk_token": "[UNK]", "sep_token": "[SEP]", "pad_token": "[PAD]", "cls_token": "[CLS]", "mask_token": "[MASK]", "tokenize_chinese_chars": true, "strip_accents": null, "bos_token": "[CLS]", "eos_token": "[EOS]", "name_or_path": "/remote-home/yfshao/workdir/code-base/Megatron-LM/init_models_ckpt/bart_zh/large", "special_tokens_map_file": "vocab/cpt_v3_vocab/special_tokens_map.json", "tokenizer_file": null}
vocab.txt CHANGED
The diff for this file is too large to render. See raw diff