Matttttttt
commited on
Commit
•
f711924
1
Parent(s):
8e2a93e
Update README.md
Browse files
README.md
CHANGED
@@ -1,3 +1,54 @@
|
|
1 |
---
|
2 |
license: cc-by-sa-4.0
|
|
|
|
|
|
|
3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
---
|
2 |
license: cc-by-sa-4.0
|
3 |
+
language:
|
4 |
+
- ja
|
5 |
+
library_name: transformers
|
6 |
---
|
7 |
+
|
8 |
+
# Model Card for Japanese BART V2 base
|
9 |
+
|
10 |
+
## Model description
|
11 |
+
|
12 |
+
This is a Japanese BART V2 base model pre-trained on Japanese Wikipedia.
|
13 |
+
|
14 |
+
## How to use
|
15 |
+
|
16 |
+
You can use this model as follows:
|
17 |
+
|
18 |
+
```python
|
19 |
+
from transformers import AutoTokenizer, AutoModelForMaskedLM
|
20 |
+
tokenizer = AutoTokenizer.from_pretrained('ku-nlp/bart-v2-base-japanese')
|
21 |
+
model = AutoModelForMaskedLM.from_pretrained('ku-nlp/bart-v2-base-japanese/')
|
22 |
+
sentence = '京都 大学 で 自然 言語 処理 を 専攻 する 。' # input should be segmented into words by Juman++ in advance
|
23 |
+
encoding = tokenizer(sentence, return_tensors='pt')
|
24 |
+
...
|
25 |
+
```
|
26 |
+
|
27 |
+
You can fine-tune this model on downstream tasks.
|
28 |
+
|
29 |
+
## Tokenization
|
30 |
+
|
31 |
+
The input text should be segmented into words by [Juman++](https://github.com/ku-nlp/jumanpp) in advance. [Juman++ 2.0.0-rc3](https://github.com/ku-nlp/jumanpp/releases/tag/v2.0.0-rc3) was used for pre-training. Each word is tokenized into subwords by [sentencepiece](https://github.com/google/sentencepiece).
|
32 |
+
|
33 |
+
## Training data
|
34 |
+
|
35 |
+
We used the following corpora for pre-training:
|
36 |
+
|
37 |
+
- Japanese Wikipedia (18M sentences)
|
38 |
+
|
39 |
+
## Training procedure
|
40 |
+
|
41 |
+
We first segmented texts in the corpora into words using [Juman++](https://github.com/ku-nlp/jumanpp).
|
42 |
+
Then, we built a sentencepiece model with 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).
|
43 |
+
|
44 |
+
We tokenized the segmented corpora into subwords using the sentencepiece model and trained the Japanese BART model using [transformers](https://github.com/huggingface/transformers) library.
|
45 |
+
The training took 2 weeks using 4 Tesla V100 GPUs.
|
46 |
+
|
47 |
+
The following hyperparameters were used during pre-training:
|
48 |
+
|
49 |
+
- distributed_type: multi-GPU
|
50 |
+
- num_devices: 4
|
51 |
+
- batch_size: 512
|
52 |
+
- training_steps: 500,000
|
53 |
+
- encoder-decoder layers: 6
|
54 |
+
- hidden: 768
|