Commit
•
c799aa4
1
Parent(s):
79a9150
support BertJapaneseTokenizer
Browse files- README.md +54 -0
- config.json +26 -0
- pytorch_model.bin +3 -0
- special_tokens_map.json +1 -0
- spiece.model +3 -0
- tokenizer_config.json +25 -0
- vocab.txt +0 -0
README.md
CHANGED
@@ -1,3 +1,57 @@
|
|
1 |
---
|
|
|
2 |
license: cc-by-sa-4.0
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
---
|
2 |
+
language: ja
|
3 |
license: cc-by-sa-4.0
|
4 |
+
datasets:
|
5 |
+
- wikipedia
|
6 |
+
- cc100
|
7 |
+
mask_token: "[MASK]"
|
8 |
+
widget:
|
9 |
+
- text: "早稲田大学で自然言語処理を[MASK]する。"
|
10 |
---
|
11 |
+
|
12 |
+
# nlp-waseda/roberta-large-japanese-seq512-with-auto-jumanpp
|
13 |
+
|
14 |
+
## Model description
|
15 |
+
|
16 |
+
This is a Japanese RoBERTa large model pretrained on Japanese Wikipedia and the Japanese portion of CC-100 with the maximum sequence length of 512.
|
17 |
+
|
18 |
+
## How to use
|
19 |
+
|
20 |
+
You can use this model for masked language modeling as follows:
|
21 |
+
```python
|
22 |
+
from transformers import AutoTokenizer, AutoModelForMaskedLM
|
23 |
+
tokenizer = AutoTokenizer.from_pretrained("nlp-waseda/roberta-large-japanese-seq512-with-auto-jumanpp")
|
24 |
+
model = AutoModelForMaskedLM.from_pretrained("nlp-waseda/roberta-large-japanese-seq512-with-auto-jumanpp")
|
25 |
+
|
26 |
+
sentence = '早稲田大学で自然言語処理を[MASK]する。'
|
27 |
+
encoding = tokenizer(sentence, return_tensors='pt')
|
28 |
+
...
|
29 |
+
```
|
30 |
+
|
31 |
+
You can fine-tune this model on downstream tasks.
|
32 |
+
|
33 |
+
## Tokenization
|
34 |
+
|
35 |
+
`BertJapaneseTokenizer` now supports automatic tokenization for [Juman++](https://github.com/ku-nlp/jumanpp). However, if your dataset is large, you may take a long time since `BertJapaneseTokenizer` still does not supoort fast tokenization. You can still do the Juman++ tokenization by your self and use the old model [nlp-waseda/roberta-large-japanese](https://huggingface.co/nlp-waseda/roberta-large-japanese).
|
36 |
+
|
37 |
+
Juman++ 2.0.0-rc3 was used for pretraining. Each word is tokenized into tokens by [sentencepiece](https://github.com/google/sentencepiece).
|
38 |
+
|
39 |
+
## Vocabulary
|
40 |
+
|
41 |
+
The vocabulary consists of 32000 tokens including words ([JumanDIC](https://github.com/ku-nlp/JumanDIC)) and subwords induced by the unigram language model of [sentencepiece](https://github.com/google/sentencepiece).
|
42 |
+
|
43 |
+
## Training procedure
|
44 |
+
|
45 |
+
This model was trained on Japanese Wikipedia (as of 20210920) and the Japanese portion of CC-100 from the checkpoint of [nlp-waseda/roberta-large-japanese](https://huggingface.co/nlp-waseda/roberta-large-japanese). It took a week using eight NVIDIA A100 GPUs.
|
46 |
+
|
47 |
+
The following hyperparameters were used during pretraining:
|
48 |
+
- learning_rate: 6e-5
|
49 |
+
- distributed_type: multi-GPU
|
50 |
+
- num_devices: 8
|
51 |
+
- total_train_batch_size: 4120 (max_seq_length=128), 4032 (max_seq_length=512)
|
52 |
+
- max_seq_length: 512
|
53 |
+
- optimizer: Adam with betas=(0.9,0.98) and epsilon=1e-6
|
54 |
+
- lr_scheduler_type: linear
|
55 |
+
- training_steps: 670000 (max_seq_length=128) + 70000 (max_seq_length=512)
|
56 |
+
- warmup_steps: 10000
|
57 |
+
- mixed_precision_training: Native AMP
|
config.json
ADDED
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"architectures": [
|
3 |
+
"RobertaForMaskedLM"
|
4 |
+
],
|
5 |
+
"attention_probs_dropout_prob": 0.1,
|
6 |
+
"bos_token_id": 2,
|
7 |
+
"classifier_dropout": null,
|
8 |
+
"eos_token_id": 3,
|
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": 514,
|
16 |
+
"model_type": "roberta",
|
17 |
+
"num_attention_heads": 16,
|
18 |
+
"num_hidden_layers": 24,
|
19 |
+
"pad_token_id": 0,
|
20 |
+
"position_embedding_type": "absolute",
|
21 |
+
"torch_dtype": "float32",
|
22 |
+
"transformers_version": "4.18.0",
|
23 |
+
"type_vocab_size": 2,
|
24 |
+
"use_cache": true,
|
25 |
+
"vocab_size": 32000
|
26 |
+
}
|
pytorch_model.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:06f4bafed9d4cc7e44d0f0714db18f9396e8410e842927b8305b05aee0cfdfeb
|
3 |
+
size 1346903275
|
special_tokens_map.json
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{"bos_token": "[CLS]", "eos_token": "[SEP]", "unk_token": "[UNK]", "sep_token": "[SEP]", "pad_token": "[PAD]", "cls_token": "[CLS]", "mask_token": {"content": "[MASK]", "single_word": false, "lstrip": true, "rstrip": false, "normalized": false}}
|
spiece.model
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:a7f87f538d8c73fb0a6a34efb7ba6e3488f920341119c02c208bce7965cf248e
|
3 |
+
size 810161
|
tokenizer_config.json
ADDED
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"do_lower_case": false,
|
3 |
+
"remove_space": true,
|
4 |
+
"keep_accents": true,
|
5 |
+
"bos_token": "[CLS]",
|
6 |
+
"eos_token": "[SEP]",
|
7 |
+
"unk_token": "[UNK]",
|
8 |
+
"sep_token": "[SEP]",
|
9 |
+
"pad_token": "[PAD]",
|
10 |
+
"cls_token": "[CLS]",
|
11 |
+
"mask_token": {
|
12 |
+
"content": "[MASK]",
|
13 |
+
"single_word": false,
|
14 |
+
"lstrip": true,
|
15 |
+
"rstrip": false,
|
16 |
+
"normalized": false,
|
17 |
+
"__type": "AddedToken"
|
18 |
+
},
|
19 |
+
"sp_model_kwargs": {},
|
20 |
+
"special_tokens_map_file": null,
|
21 |
+
"tokenizer_class": "BertJapaneseTokenizer",
|
22 |
+
"word_tokenizer_type": "jumanpp",
|
23 |
+
"subword_tokenizer_type": "wordpiece",
|
24 |
+
"jumanpp_kwargs": {}
|
25 |
+
}
|
vocab.txt
ADDED
The diff for this file is too large to render.
See raw diff
|
|