初始化项目,由ModelHub XC社区提供模型
Model: benjamin/gpt2-wechsel-chinese Source: Original Platform
This commit is contained in:
27
.gitattributes
vendored
Normal file
27
.gitattributes
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
*.7z filter=lfs diff=lfs merge=lfs -text
|
||||
*.arrow filter=lfs diff=lfs merge=lfs -text
|
||||
*.bin filter=lfs diff=lfs merge=lfs -text
|
||||
*.bin.* filter=lfs diff=lfs merge=lfs -text
|
||||
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
||||
*.ftz filter=lfs diff=lfs merge=lfs -text
|
||||
*.gz filter=lfs diff=lfs merge=lfs -text
|
||||
*.h5 filter=lfs diff=lfs merge=lfs -text
|
||||
*.joblib filter=lfs diff=lfs merge=lfs -text
|
||||
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
||||
*.model filter=lfs diff=lfs merge=lfs -text
|
||||
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
||||
*.onnx filter=lfs diff=lfs merge=lfs -text
|
||||
*.ot filter=lfs diff=lfs merge=lfs -text
|
||||
*.parquet filter=lfs diff=lfs merge=lfs -text
|
||||
*.pb filter=lfs diff=lfs merge=lfs -text
|
||||
*.pt filter=lfs diff=lfs merge=lfs -text
|
||||
*.pth filter=lfs diff=lfs merge=lfs -text
|
||||
*.rar filter=lfs diff=lfs merge=lfs -text
|
||||
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
||||
*.tar.* filter=lfs diff=lfs merge=lfs -text
|
||||
*.tflite filter=lfs diff=lfs merge=lfs -text
|
||||
*.tgz filter=lfs diff=lfs merge=lfs -text
|
||||
*.xz filter=lfs diff=lfs merge=lfs -text
|
||||
*.zip filter=lfs diff=lfs merge=lfs -text
|
||||
*.zstandard filter=lfs diff=lfs merge=lfs -text
|
||||
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
||||
82
README.md
Normal file
82
README.md
Normal file
@@ -0,0 +1,82 @@
|
||||
---
|
||||
language: zh
|
||||
license: mit
|
||||
---
|
||||
|
||||
# gpt2-wechsel-chinese
|
||||
|
||||
Model trained with WECHSEL: Effective initialization of subword embeddings for cross-lingual transfer of monolingual language models.
|
||||
|
||||
See the code here: https://github.com/CPJKU/wechsel
|
||||
|
||||
And the paper here: https://aclanthology.org/2022.naacl-main.293/
|
||||
|
||||
## Performance
|
||||
|
||||
### RoBERTa
|
||||
|
||||
| Model | NLI Score | NER Score | Avg Score |
|
||||
|---|---|---|---|
|
||||
| `roberta-base-wechsel-french` | **82.43** | **90.88** | **86.65** |
|
||||
| `camembert-base` | 80.88 | 90.26 | 85.57 |
|
||||
|
||||
|
||||
| Model | NLI Score | NER Score | Avg Score |
|
||||
|---|---|---|---|
|
||||
| `roberta-base-wechsel-german` | **81.79** | **89.72** | **85.76** |
|
||||
| `deepset/gbert-base` | 78.64 | 89.46 | 84.05 |
|
||||
|
||||
| Model | NLI Score | NER Score | Avg Score |
|
||||
|---|---|---|---|
|
||||
| `roberta-base-wechsel-chinese` | **78.32** | 80.55 | **79.44** |
|
||||
| `bert-base-chinese` | 76.55 | **82.05** | 79.30 |
|
||||
|
||||
| Model | NLI Score | NER Score | Avg Score |
|
||||
|---|---|---|---|
|
||||
| `roberta-base-wechsel-swahili` | **75.05** | **87.39** | **81.22** |
|
||||
| `xlm-roberta-base` | 69.18 | 87.37 | 78.28 |
|
||||
|
||||
### GPT2
|
||||
|
||||
| Model | PPL |
|
||||
|---|---|
|
||||
| `gpt2-wechsel-french` | **19.71** |
|
||||
| `gpt2` (retrained from scratch) | 20.47 |
|
||||
|
||||
| Model | PPL |
|
||||
|---|---|
|
||||
| `gpt2-wechsel-german` | **26.8** |
|
||||
| `gpt2` (retrained from scratch) | 27.63 |
|
||||
|
||||
| Model | PPL |
|
||||
|---|---|
|
||||
| `gpt2-wechsel-chinese` | **51.97** |
|
||||
| `gpt2` (retrained from scratch) | 52.98 |
|
||||
|
||||
| Model | PPL |
|
||||
|---|---|
|
||||
| `gpt2-wechsel-swahili` | **10.14** |
|
||||
| `gpt2` (retrained from scratch) | 10.58 |
|
||||
|
||||
See our paper for details.
|
||||
|
||||
## Citation
|
||||
|
||||
Please cite WECHSEL as
|
||||
|
||||
```
|
||||
@inproceedings{minixhofer-etal-2022-wechsel,
|
||||
title = "{WECHSEL}: Effective initialization of subword embeddings for cross-lingual transfer of monolingual language models",
|
||||
author = "Minixhofer, Benjamin and
|
||||
Paischer, Fabian and
|
||||
Rekabsaz, Navid",
|
||||
booktitle = "Proceedings of the 2022 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies",
|
||||
month = jul,
|
||||
year = "2022",
|
||||
address = "Seattle, United States",
|
||||
publisher = "Association for Computational Linguistics",
|
||||
url = "https://aclanthology.org/2022.naacl-main.293",
|
||||
pages = "3992--4006",
|
||||
abstract = "Large pretrained language models (LMs) have become the central building block of many NLP applications. Training these models requires ever more computational resources and most of the existing models are trained on English text only. It is exceedingly expensive to train these models in other languages. To alleviate this problem, we introduce a novel method {--} called WECHSEL {--} to efficiently and effectively transfer pretrained LMs to new languages. WECHSEL can be applied to any model which uses subword-based tokenization and learns an embedding for each subword. The tokenizer of the source model (in English) is replaced with a tokenizer in the target language and token embeddings are initialized such that they are semantically similar to the English tokens by utilizing multilingual static word embeddings covering English and the target language. We use WECHSEL to transfer the English RoBERTa and GPT-2 models to four languages (French, German, Chinese and Swahili). We also study the benefits of our method on very low-resource languages. WECHSEL improves over proposed methods for cross-lingual parameter transfer and outperforms models of comparable size trained from scratch with up to 64x less training effort. Our method makes training large language models for new languages more accessible and less damaging to the environment. We make our code and models publicly available.",
|
||||
}
|
||||
```
|
||||
40
config.json
Normal file
40
config.json
Normal file
@@ -0,0 +1,40 @@
|
||||
{
|
||||
"_name_or_path": "gpt2",
|
||||
"activation_function": "gelu_new",
|
||||
"architectures": [
|
||||
"GPT2LMHeadModel"
|
||||
],
|
||||
"attn_pdrop": 0.1,
|
||||
"bos_token_id": 50256,
|
||||
"embd_pdrop": 0.1,
|
||||
"eos_token_id": 50256,
|
||||
"gradient_checkpointing": false,
|
||||
"initializer_range": 0.02,
|
||||
"layer_norm_epsilon": 1e-05,
|
||||
"model_type": "gpt2",
|
||||
"n_ctx": 1024,
|
||||
"n_embd": 768,
|
||||
"n_head": 12,
|
||||
"n_inner": null,
|
||||
"n_layer": 12,
|
||||
"n_positions": 1024,
|
||||
"reorder_and_upcast_attn": false,
|
||||
"resid_pdrop": 0.1,
|
||||
"scale_attn_by_inverse_layer_idx": false,
|
||||
"scale_attn_weights": true,
|
||||
"summary_activation": null,
|
||||
"summary_first_dropout": 0.1,
|
||||
"summary_proj_to_labels": true,
|
||||
"summary_type": "cls_index",
|
||||
"summary_use_proj": true,
|
||||
"task_specific_params": {
|
||||
"text-generation": {
|
||||
"do_sample": true,
|
||||
"max_length": 50
|
||||
}
|
||||
},
|
||||
"torch_dtype": "float32",
|
||||
"transformers_version": "4.12.0.dev0",
|
||||
"use_cache": true,
|
||||
"vocab_size": 50257
|
||||
}
|
||||
50015
merges.txt
Normal file
50015
merges.txt
Normal file
File diff suppressed because it is too large
Load Diff
3
optimizer.pt
Normal file
3
optimizer.pt
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:37b50e3916ebb15b45dc0b0d9e09acbf369cd17c771cff9e1c3e9cec584de8c9
|
||||
size 995605175
|
||||
3
pytorch_model.bin
Normal file
3
pytorch_model.bin
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:09e9ce9d7ff670a7c437415d3d24979360cc5d4a5ba661c682881af596e8f783
|
||||
size 664786896
|
||||
3
rng_state_0.pth
Normal file
3
rng_state_0.pth
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:43f24131fe1c5c5f6befa35ff7727f7bfa10dcb8fa479fda21ef19a3cdeb7a8b
|
||||
size 13620
|
||||
3
rng_state_1.pth
Normal file
3
rng_state_1.pth
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:11d2bc572cf758428d3601b4b178b7abd8ae128dcc92f954b77661469e312b3f
|
||||
size 13619
|
||||
3
rng_state_2.pth
Normal file
3
rng_state_2.pth
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:070d351b9dfebb5d97ce8304bb299058729ce8c719a0d310d3652156f2670d23
|
||||
size 13619
|
||||
3
rng_state_3.pth
Normal file
3
rng_state_3.pth
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:b6274896c35a74acff93da458f592abcf922516f1e48f1c9df62ab55586c397f
|
||||
size 13619
|
||||
3
rng_state_4.pth
Normal file
3
rng_state_4.pth
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:0c0a85fcd503b13ae788954ea0918a415541cdc7d94abcc8c2725c4108663088
|
||||
size 13619
|
||||
3
rng_state_5.pth
Normal file
3
rng_state_5.pth
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:89ed5588321ee32056c9455463e04ad31aa74da72f0bf3f3306a0ce190138f5a
|
||||
size 13619
|
||||
3
rng_state_6.pth
Normal file
3
rng_state_6.pth
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:ff40acf5bd8e18b940cacd6844d4bddc30955308ad1cece1b7f674a287b18a7d
|
||||
size 13619
|
||||
3
rng_state_7.pth
Normal file
3
rng_state_7.pth
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:bbd7f41cc7d60260ce1701c4703346b5be2eff76225e84c4a0de7c5723268a75
|
||||
size 13619
|
||||
3
scheduler.pt
Normal file
3
scheduler.pt
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:8b8c2901014d2c746054e1735a8a2f265c07415813cf3bf160eca907e91a7dbb
|
||||
size 623
|
||||
1
special_tokens_map.json
Normal file
1
special_tokens_map.json
Normal file
@@ -0,0 +1 @@
|
||||
{"bos_token": "<|endoftext|>", "eos_token": "<|endoftext|>", "unk_token": "<|endoftext|>"}
|
||||
1
tokenizer.json
Normal file
1
tokenizer.json
Normal file
File diff suppressed because one or more lines are too long
1
tokenizer_config.json
Normal file
1
tokenizer_config.json
Normal file
@@ -0,0 +1 @@
|
||||
{"unk_token": "<|endoftext|>", "bos_token": "<|endoftext|>", "eos_token": "<|endoftext|>", "add_prefix_space": false, "model_max_length": 1024, "special_tokens_map_file": null, "name_or_path": "models/gpt2_chinese", "tokenizer_class": "GPT2Tokenizer"}
|
||||
3676
trainer_state.json
Normal file
3676
trainer_state.json
Normal file
File diff suppressed because it is too large
Load Diff
3
training_args.bin
Normal file
3
training_args.bin
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:f4ef21f1648f7dfb356b4090f9e544e98f071889713977adfad65f0c8ff73f1e
|
||||
size 2927
|
||||
1
vocab.json
Normal file
1
vocab.json
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user