dkawahara commited on
Commit
f2626e8
1 Parent(s): 2e17744

Initial release.

Browse files
README.md CHANGED
@@ -1,3 +1,61 @@
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
13
+
14
+ ## Model description
15
+
16
+ This is a Japanese RoBERTa large model pretrained on Japanese Wikipedia and the Japanese portion of CC-100.
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-base-japanese")
24
+ model = AutoModelForMaskedLM.from_pretrained("nlp-waseda/roberta-base-japanese")
25
+
26
+ sentence = '早稲田 大学 で 自然 言語 処理 を [MASK] する 。' # input should be segmented into words by Juman++ in advance
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
+ The input text should be segmented into words by [Juman++](https://github.com/ku-nlp/jumanpp) in advance. Juman++ 2.0.0-rc3 was used for pretraining. Each word is tokenized into tokens by [sentencepiece](https://github.com/google/sentencepiece).
36
+
37
+ ## Vocabulary
38
+
39
+ 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).
40
+
41
+ ## Training procedure
42
+
43
+ This model was trained on Japanese Wikipedia (as of 20210920) and the Japanese portion of CC-100. It took two weeks using eight NVIDIA A100 GPUs.
44
+
45
+ The following hyperparameters were used during pretraining:
46
+ - learning_rate: 6e-5
47
+ - per_device_train_batch_size: 103
48
+ - distributed_type: multi-GPU
49
+ - num_devices: 8
50
+ - gradient_accumulation_steps: 5
51
+ - total_train_batch_size: 4120
52
+ - max_seq_length: 128
53
+ - optimizer: Adam with betas=(0.9,0.98) and epsilon=1e-6
54
+ - lr_scheduler_type: linear
55
+ - training_steps: 670000
56
+ - warmup_steps: 10000
57
+ - mixed_precision_training: Native AMP
58
+
59
+ ## Performance on JGLUE
60
+
61
+ coming soon
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:eab6f3c1b61cc3f7337d480e085840e8dfa0342434da467e32d15ac5ccd08244
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 @@
 
 
1
+ {"do_lower_case": false, "remove_space": true, "keep_accents": true, "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, "__type": "AddedToken"}, "sp_model_kwargs": {}, "special_tokens_map_file": null, "tokenizer_class": "AlbertTokenizer"}