Spaces:
Running
Running
clean
Browse files- bert/chinese-roberta-wwm-ext-large/.gitattributes +0 -9
- bert/chinese-roberta-wwm-ext-large/README.md +0 -57
- bert/chinese-roberta-wwm-ext-large/added_tokens.json +0 -1
- bert/chinese-roberta-wwm-ext-large/config.json +0 -28
- bert/chinese-roberta-wwm-ext-large/pytorch_model.bin +0 -3
- bert/chinese-roberta-wwm-ext-large/special_tokens_map.json +0 -1
- bert/chinese-roberta-wwm-ext-large/tokenizer.json +0 -0
- bert/chinese-roberta-wwm-ext-large/tokenizer_config.json +0 -1
- bert/chinese-roberta-wwm-ext-large/vocab.txt +0 -0
- bert/deberta-v3-large/.gitattributes +0 -27
- bert/deberta-v3-large/README.md +0 -93
- bert/deberta-v3-large/config.json +0 -22
- bert/deberta-v3-large/generator_config.json +0 -22
- bert/deberta-v3-large/pytorch_model.bin +0 -3
- bert/deberta-v3-large/pytorch_model.bin.bin +0 -3
- bert/deberta-v3-large/spm.model +0 -3
- bert/deberta-v3-large/tokenizer_config.json +0 -4
- requirements.txt +6 -6
bert/chinese-roberta-wwm-ext-large/.gitattributes
DELETED
@@ -1,9 +0,0 @@
|
|
1 |
-
*.bin.* filter=lfs diff=lfs merge=lfs -text
|
2 |
-
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
3 |
-
*.bin filter=lfs diff=lfs merge=lfs -text
|
4 |
-
*.h5 filter=lfs diff=lfs merge=lfs -text
|
5 |
-
*.tflite filter=lfs diff=lfs merge=lfs -text
|
6 |
-
*.tar.gz filter=lfs diff=lfs merge=lfs -text
|
7 |
-
*.ot filter=lfs diff=lfs merge=lfs -text
|
8 |
-
*.onnx filter=lfs diff=lfs merge=lfs -text
|
9 |
-
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bert/chinese-roberta-wwm-ext-large/README.md
DELETED
@@ -1,57 +0,0 @@
|
|
1 |
-
---
|
2 |
-
language:
|
3 |
-
- zh
|
4 |
-
tags:
|
5 |
-
- bert
|
6 |
-
license: "apache-2.0"
|
7 |
-
---
|
8 |
-
|
9 |
-
# Please use 'Bert' related functions to load this model!
|
10 |
-
|
11 |
-
## Chinese BERT with Whole Word Masking
|
12 |
-
For further accelerating Chinese natural language processing, we provide **Chinese pre-trained BERT with Whole Word Masking**.
|
13 |
-
|
14 |
-
**[Pre-Training with Whole Word Masking for Chinese BERT](https://arxiv.org/abs/1906.08101)**
|
15 |
-
Yiming Cui, Wanxiang Che, Ting Liu, Bing Qin, Ziqing Yang, Shijin Wang, Guoping Hu
|
16 |
-
|
17 |
-
This repository is developed based on:https://github.com/google-research/bert
|
18 |
-
|
19 |
-
You may also interested in,
|
20 |
-
- Chinese BERT series: https://github.com/ymcui/Chinese-BERT-wwm
|
21 |
-
- Chinese MacBERT: https://github.com/ymcui/MacBERT
|
22 |
-
- Chinese ELECTRA: https://github.com/ymcui/Chinese-ELECTRA
|
23 |
-
- Chinese XLNet: https://github.com/ymcui/Chinese-XLNet
|
24 |
-
- Knowledge Distillation Toolkit - TextBrewer: https://github.com/airaria/TextBrewer
|
25 |
-
|
26 |
-
More resources by HFL: https://github.com/ymcui/HFL-Anthology
|
27 |
-
|
28 |
-
## Citation
|
29 |
-
If you find the technical report or resource is useful, please cite the following technical report in your paper.
|
30 |
-
- Primary: https://arxiv.org/abs/2004.13922
|
31 |
-
```
|
32 |
-
@inproceedings{cui-etal-2020-revisiting,
|
33 |
-
title = "Revisiting Pre-Trained Models for {C}hinese Natural Language Processing",
|
34 |
-
author = "Cui, Yiming and
|
35 |
-
Che, Wanxiang and
|
36 |
-
Liu, Ting and
|
37 |
-
Qin, Bing and
|
38 |
-
Wang, Shijin and
|
39 |
-
Hu, Guoping",
|
40 |
-
booktitle = "Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing: Findings",
|
41 |
-
month = nov,
|
42 |
-
year = "2020",
|
43 |
-
address = "Online",
|
44 |
-
publisher = "Association for Computational Linguistics",
|
45 |
-
url = "https://www.aclweb.org/anthology/2020.findings-emnlp.58",
|
46 |
-
pages = "657--668",
|
47 |
-
}
|
48 |
-
```
|
49 |
-
- Secondary: https://arxiv.org/abs/1906.08101
|
50 |
-
```
|
51 |
-
@article{chinese-bert-wwm,
|
52 |
-
title={Pre-Training with Whole Word Masking for Chinese BERT},
|
53 |
-
author={Cui, Yiming and Che, Wanxiang and Liu, Ting and Qin, Bing and Yang, Ziqing and Wang, Shijin and Hu, Guoping},
|
54 |
-
journal={arXiv preprint arXiv:1906.08101},
|
55 |
-
year={2019}
|
56 |
-
}
|
57 |
-
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bert/chinese-roberta-wwm-ext-large/added_tokens.json
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
{}
|
|
|
|
bert/chinese-roberta-wwm-ext-large/config.json
DELETED
@@ -1,28 +0,0 @@
|
|
1 |
-
{
|
2 |
-
"architectures": [
|
3 |
-
"BertForMaskedLM"
|
4 |
-
],
|
5 |
-
"attention_probs_dropout_prob": 0.1,
|
6 |
-
"bos_token_id": 0,
|
7 |
-
"directionality": "bidi",
|
8 |
-
"eos_token_id": 2,
|
9 |
-
"hidden_act": "gelu",
|
10 |
-
"hidden_dropout_prob": 0.1,
|
11 |
-
"hidden_size": 1024,
|
12 |
-
"initializer_range": 0.02,
|
13 |
-
"intermediate_size": 4096,
|
14 |
-
"layer_norm_eps": 1e-12,
|
15 |
-
"max_position_embeddings": 512,
|
16 |
-
"model_type": "bert",
|
17 |
-
"num_attention_heads": 16,
|
18 |
-
"num_hidden_layers": 24,
|
19 |
-
"output_past": true,
|
20 |
-
"pad_token_id": 0,
|
21 |
-
"pooler_fc_size": 768,
|
22 |
-
"pooler_num_attention_heads": 12,
|
23 |
-
"pooler_num_fc_layers": 3,
|
24 |
-
"pooler_size_per_head": 128,
|
25 |
-
"pooler_type": "first_token_transform",
|
26 |
-
"type_vocab_size": 2,
|
27 |
-
"vocab_size": 21128
|
28 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bert/chinese-roberta-wwm-ext-large/pytorch_model.bin
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:4ac62d49144d770c5ca9a5d1d3039c4995665a080febe63198189857c6bd11cd
|
3 |
-
size 1306484351
|
|
|
|
|
|
|
|
bert/chinese-roberta-wwm-ext-large/special_tokens_map.json
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
{"unk_token": "[UNK]", "sep_token": "[SEP]", "pad_token": "[PAD]", "cls_token": "[CLS]", "mask_token": "[MASK]"}
|
|
|
|
bert/chinese-roberta-wwm-ext-large/tokenizer.json
DELETED
The diff for this file is too large to render.
See raw diff
|
|
bert/chinese-roberta-wwm-ext-large/tokenizer_config.json
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
{"init_inputs": []}
|
|
|
|
bert/chinese-roberta-wwm-ext-large/vocab.txt
DELETED
The diff for this file is too large to render.
See raw diff
|
|
bert/deberta-v3-large/.gitattributes
DELETED
@@ -1,27 +0,0 @@
|
|
1 |
-
*.7z filter=lfs diff=lfs merge=lfs -text
|
2 |
-
*.arrow filter=lfs diff=lfs merge=lfs -text
|
3 |
-
*.bin filter=lfs diff=lfs merge=lfs -text
|
4 |
-
*.bin.* filter=lfs diff=lfs merge=lfs -text
|
5 |
-
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
6 |
-
*.ftz filter=lfs diff=lfs merge=lfs -text
|
7 |
-
*.gz filter=lfs diff=lfs merge=lfs -text
|
8 |
-
*.h5 filter=lfs diff=lfs merge=lfs -text
|
9 |
-
*.joblib filter=lfs diff=lfs merge=lfs -text
|
10 |
-
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
11 |
-
*.model filter=lfs diff=lfs merge=lfs -text
|
12 |
-
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
13 |
-
*.onnx filter=lfs diff=lfs merge=lfs -text
|
14 |
-
*.ot filter=lfs diff=lfs merge=lfs -text
|
15 |
-
*.parquet filter=lfs diff=lfs merge=lfs -text
|
16 |
-
*.pb filter=lfs diff=lfs merge=lfs -text
|
17 |
-
*.pt filter=lfs diff=lfs merge=lfs -text
|
18 |
-
*.pth filter=lfs diff=lfs merge=lfs -text
|
19 |
-
*.rar filter=lfs diff=lfs merge=lfs -text
|
20 |
-
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
21 |
-
*.tar.* filter=lfs diff=lfs merge=lfs -text
|
22 |
-
*.tflite filter=lfs diff=lfs merge=lfs -text
|
23 |
-
*.tgz filter=lfs diff=lfs merge=lfs -text
|
24 |
-
*.xz filter=lfs diff=lfs merge=lfs -text
|
25 |
-
*.zip filter=lfs diff=lfs merge=lfs -text
|
26 |
-
*.zstandard filter=lfs diff=lfs merge=lfs -text
|
27 |
-
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bert/deberta-v3-large/README.md
DELETED
@@ -1,93 +0,0 @@
|
|
1 |
-
---
|
2 |
-
language: en
|
3 |
-
tags:
|
4 |
-
- deberta
|
5 |
-
- deberta-v3
|
6 |
-
- fill-mask
|
7 |
-
thumbnail: https://huggingface.co/front/thumbnails/microsoft.png
|
8 |
-
license: mit
|
9 |
-
---
|
10 |
-
|
11 |
-
## DeBERTaV3: Improving DeBERTa using ELECTRA-Style Pre-Training with Gradient-Disentangled Embedding Sharing
|
12 |
-
|
13 |
-
[DeBERTa](https://arxiv.org/abs/2006.03654) improves the BERT and RoBERTa models using disentangled attention and enhanced mask decoder. With those two improvements, DeBERTa out perform RoBERTa on a majority of NLU tasks with 80GB training data.
|
14 |
-
|
15 |
-
In [DeBERTa V3](https://arxiv.org/abs/2111.09543), we further improved the efficiency of DeBERTa using ELECTRA-Style pre-training with Gradient Disentangled Embedding Sharing. Compared to DeBERTa, our V3 version significantly improves the model performance on downstream tasks. You can find more technique details about the new model from our [paper](https://arxiv.org/abs/2111.09543).
|
16 |
-
|
17 |
-
Please check the [official repository](https://github.com/microsoft/DeBERTa) for more implementation details and updates.
|
18 |
-
|
19 |
-
The DeBERTa V3 large model comes with 24 layers and a hidden size of 1024. It has 304M backbone parameters with a vocabulary containing 128K tokens which introduces 131M parameters in the Embedding layer. This model was trained using the 160GB data as DeBERTa V2.
|
20 |
-
|
21 |
-
|
22 |
-
#### Fine-tuning on NLU tasks
|
23 |
-
|
24 |
-
We present the dev results on SQuAD 2.0 and MNLI tasks.
|
25 |
-
|
26 |
-
| Model |Vocabulary(K)|Backbone #Params(M)| SQuAD 2.0(F1/EM) | MNLI-m/mm(ACC)|
|
27 |
-
|-------------------|----------|-------------------|-----------|----------|
|
28 |
-
| RoBERTa-large |50 |304 | 89.4/86.5 | 90.2 |
|
29 |
-
| XLNet-large |32 |- | 90.6/87.9 | 90.8 |
|
30 |
-
| DeBERTa-large |50 |- | 90.7/88.0 | 91.3 |
|
31 |
-
| **DeBERTa-v3-large**|128|304 | **91.5/89.0**| **91.8/91.9**|
|
32 |
-
|
33 |
-
|
34 |
-
#### Fine-tuning with HF transformers
|
35 |
-
|
36 |
-
```bash
|
37 |
-
#!/bin/bash
|
38 |
-
|
39 |
-
cd transformers/examples/pytorch/text-classification/
|
40 |
-
|
41 |
-
pip install datasets
|
42 |
-
export TASK_NAME=mnli
|
43 |
-
|
44 |
-
output_dir="ds_results"
|
45 |
-
|
46 |
-
num_gpus=8
|
47 |
-
|
48 |
-
batch_size=8
|
49 |
-
|
50 |
-
python -m torch.distributed.launch --nproc_per_node=${num_gpus} \
|
51 |
-
run_glue.py \
|
52 |
-
--model_name_or_path microsoft/deberta-v3-large \
|
53 |
-
--task_name $TASK_NAME \
|
54 |
-
--do_train \
|
55 |
-
--do_eval \
|
56 |
-
--evaluation_strategy steps \
|
57 |
-
--max_seq_length 256 \
|
58 |
-
--warmup_steps 50 \
|
59 |
-
--per_device_train_batch_size ${batch_size} \
|
60 |
-
--learning_rate 6e-6 \
|
61 |
-
--num_train_epochs 2 \
|
62 |
-
--output_dir $output_dir \
|
63 |
-
--overwrite_output_dir \
|
64 |
-
--logging_steps 1000 \
|
65 |
-
--logging_dir $output_dir
|
66 |
-
|
67 |
-
```
|
68 |
-
|
69 |
-
### Citation
|
70 |
-
|
71 |
-
If you find DeBERTa useful for your work, please cite the following papers:
|
72 |
-
|
73 |
-
``` latex
|
74 |
-
@misc{he2021debertav3,
|
75 |
-
title={DeBERTaV3: Improving DeBERTa using ELECTRA-Style Pre-Training with Gradient-Disentangled Embedding Sharing},
|
76 |
-
author={Pengcheng He and Jianfeng Gao and Weizhu Chen},
|
77 |
-
year={2021},
|
78 |
-
eprint={2111.09543},
|
79 |
-
archivePrefix={arXiv},
|
80 |
-
primaryClass={cs.CL}
|
81 |
-
}
|
82 |
-
```
|
83 |
-
|
84 |
-
``` latex
|
85 |
-
@inproceedings{
|
86 |
-
he2021deberta,
|
87 |
-
title={DEBERTA: DECODING-ENHANCED BERT WITH DISENTANGLED ATTENTION},
|
88 |
-
author={Pengcheng He and Xiaodong Liu and Jianfeng Gao and Weizhu Chen},
|
89 |
-
booktitle={International Conference on Learning Representations},
|
90 |
-
year={2021},
|
91 |
-
url={https://openreview.net/forum?id=XPZIaotutsD}
|
92 |
-
}
|
93 |
-
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bert/deberta-v3-large/config.json
DELETED
@@ -1,22 +0,0 @@
|
|
1 |
-
{
|
2 |
-
"model_type": "deberta-v2",
|
3 |
-
"attention_probs_dropout_prob": 0.1,
|
4 |
-
"hidden_act": "gelu",
|
5 |
-
"hidden_dropout_prob": 0.1,
|
6 |
-
"hidden_size": 1024,
|
7 |
-
"initializer_range": 0.02,
|
8 |
-
"intermediate_size": 4096,
|
9 |
-
"max_position_embeddings": 512,
|
10 |
-
"relative_attention": true,
|
11 |
-
"position_buckets": 256,
|
12 |
-
"norm_rel_ebd": "layer_norm",
|
13 |
-
"share_att_key": true,
|
14 |
-
"pos_att_type": "p2c|c2p",
|
15 |
-
"layer_norm_eps": 1e-7,
|
16 |
-
"max_relative_positions": -1,
|
17 |
-
"position_biased_input": false,
|
18 |
-
"num_attention_heads": 16,
|
19 |
-
"num_hidden_layers": 24,
|
20 |
-
"type_vocab_size": 0,
|
21 |
-
"vocab_size": 128100
|
22 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bert/deberta-v3-large/generator_config.json
DELETED
@@ -1,22 +0,0 @@
|
|
1 |
-
{
|
2 |
-
"model_type": "deberta-v2",
|
3 |
-
"attention_probs_dropout_prob": 0.1,
|
4 |
-
"hidden_act": "gelu",
|
5 |
-
"hidden_dropout_prob": 0.1,
|
6 |
-
"hidden_size": 1024,
|
7 |
-
"initializer_range": 0.02,
|
8 |
-
"intermediate_size": 4096,
|
9 |
-
"max_position_embeddings": 512,
|
10 |
-
"relative_attention": true,
|
11 |
-
"position_buckets": 256,
|
12 |
-
"norm_rel_ebd": "layer_norm",
|
13 |
-
"share_att_key": true,
|
14 |
-
"pos_att_type": "p2c|c2p",
|
15 |
-
"layer_norm_eps": 1e-7,
|
16 |
-
"max_relative_positions": -1,
|
17 |
-
"position_biased_input": false,
|
18 |
-
"num_attention_heads": 16,
|
19 |
-
"num_hidden_layers": 12,
|
20 |
-
"type_vocab_size": 0,
|
21 |
-
"vocab_size": 128100
|
22 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bert/deberta-v3-large/pytorch_model.bin
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:dd5b5d93e2db101aaf281df0ea1216c07ad73620ff59c5b42dccac4bf2eef5b5
|
3 |
-
size 873673253
|
|
|
|
|
|
|
|
bert/deberta-v3-large/pytorch_model.bin.bin
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:dd5b5d93e2db101aaf281df0ea1216c07ad73620ff59c5b42dccac4bf2eef5b5
|
3 |
-
size 873673253
|
|
|
|
|
|
|
|
bert/deberta-v3-large/spm.model
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:c679fbf93643d19aab7ee10c0b99e460bdbc02fedf34b92b05af343b4af586fd
|
3 |
-
size 2464616
|
|
|
|
|
|
|
|
bert/deberta-v3-large/tokenizer_config.json
DELETED
@@ -1,4 +0,0 @@
|
|
1 |
-
{
|
2 |
-
"do_lower_case": false,
|
3 |
-
"vocab_type": "spm"
|
4 |
-
}
|
|
|
|
|
|
|
|
|
|
requirements.txt
CHANGED
@@ -1,8 +1,8 @@
|
|
1 |
-
cmudict
|
2 |
-
cn2an
|
3 |
# faster-whisper==0.10.1
|
4 |
-
g2p_en
|
5 |
-
GPUtil
|
6 |
gradio
|
7 |
jieba
|
8 |
# librosa==0.9.2
|
@@ -10,12 +10,12 @@ loguru
|
|
10 |
num2words
|
11 |
numpy<2
|
12 |
# protobuf==4.25
|
13 |
-
psutil
|
14 |
# punctuators
|
15 |
pyannote.audio>=3.1.0
|
16 |
# pyloudnorm
|
17 |
pyopenjtalk-dict
|
18 |
-
pypinyin
|
19 |
pyworld-prebuilt
|
20 |
# stable_ts
|
21 |
# tensorboard
|
|
|
1 |
+
# cmudict
|
2 |
+
# cn2an
|
3 |
# faster-whisper==0.10.1
|
4 |
+
# g2p_en
|
5 |
+
# GPUtil
|
6 |
gradio
|
7 |
jieba
|
8 |
# librosa==0.9.2
|
|
|
10 |
num2words
|
11 |
numpy<2
|
12 |
# protobuf==4.25
|
13 |
+
# psutil
|
14 |
# punctuators
|
15 |
pyannote.audio>=3.1.0
|
16 |
# pyloudnorm
|
17 |
pyopenjtalk-dict
|
18 |
+
# pypinyin
|
19 |
pyworld-prebuilt
|
20 |
# stable_ts
|
21 |
# tensorboard
|