Downloads · 30 days
1.7K
2% of all-time downloads
ku-nlp/gpt2-small-japanese-char
gpt2-small-japanese-char is a text generation model from ku-nlp. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as cc-by-sa-4.0.
This is a Japanese character-level GPT-2 Small (90M parameters) language model pre-trained on Japanese Wikipedia, the Japanese portion of CC-100, and the Japanese portion of OSCAR.
Downloads · 30 days
1.7K
2% of all-time downloads
All-time downloads
92.7K
Public
Parameters
103M
1.5 GB on disk
Likes
3
Public
Click a slice to open those files.
.bin374 MB · 50%
How the weights are stored.
F3290.5M · 88%
From the Hugging Face model README
This is a Japanese character-level GPT-2 Small (90M parameters) language model pre-trained on Japanese Wikipedia, the Japanese portion of CC-100, and the Japanese portion of OSCAR.
You can use this model directly with a pipeline for text generation.
>>> from transformers import pipeline, set_seed
>>> generator = pipeline('text-generation', model='ku-nlp/gpt2-small-japanese-char')
>>> set_seed(5)
>>> generator("<s>昨日私は京都で", max_length=30, do_sample=True, num_return_sequences=5)
[{'generated_text': '<s>昨日私は京都で仕事して、今日は大阪に行くのですが今日はいつ'},
{'generated_text': '<s>昨日私は京都で開催された「みんなで!アラーム学習アワード2'},
{'generated_text': '<s>昨日私は京都で行われましたコンフェクションフォーラムへ行っ'},
{'generated_text': '<s>昨日私は京都では雪が解けるまで寝た様子があります・・・(;'},
{'generated_text': '<s>昨日私は京都でも27回生の卒業式を行わせていただいておりま'}]
You can also use this model to get the features of a given text.
A character-level vocabulary of size 6K is used. To be precise, rare characters may be split into bytes because byte-level byte-pair encoding (BPE) is used. The BPE tokenizer was trained on a small subset of the training data. Since the data were converted into a one-character-per-line format, merge operations never go beyond character boundaries.
Note that the tokenizer maps U+0020 to [UNK] because preprocessing eliminated whitespace characters (U+0020) from training data. Use U+3000 (Ideographic Space) instead.
We used the following corpora for pre-training:
Note that we filtered out documents annotated with "header", "footer", or "noisy" tags in OSCAR. Also note that Japanese Wikipedia was duplicated 10 times to make the total size of the corpus comparable to that of CC-100 and OSCAR. As a result, the total size of the training data is 171GB.
The training took about 3 months (with two interruptions) with a single NVIDIA A100 80GB GPU.
The following hyperparameters were used during pre-training:
The eval loss was 1.597 while the eval accuracy was 0.6359. The evaluation set consists of 5,000 randomly sampled documents from each of the training corpora.