colorfulscoop / gpt2-small-ja

huggingface.co
Total runs: 1.0K
24-hour runs: 0
7-day runs: -29
30-day runs: 605
Model's Last Updated: September 27 2021
text-generation

Introduction of gpt2-small-ja

Model Details of gpt2-small-ja

GPT-2 small Japanese model

This repository contains a GPT2-small model trained on Japanese Wikipedia dataset.

Training data

Japanese Wikipedia dataset as of Aug20, 2021 released under Creative Commons Attribution-ShareAlike 3.0 is used for both tokenizer and GPT-2 model.

We splitted the dataset into three subsets - train, valid and test sets. Both tokenizer and model were trained on the train set. Train set contains around 540M tokens.

Model description

The model architecture is the same as GPT-2 small model (n_ctx: 1024, n_embd 768, n_head: 12, n_layer: 12) except for a vocabulary size. The vocabulary size is set to 32,000 instead of an original size of 50,257. transformers.GPT2LMHeadModel is used for training.

Tokenizer description

SentencePiece is used as a tokenizer for this model.

We utilized 1,000,000 sentences from train set. The vocabulary size was 32,000. A add_dummy_prefix option was set to True because Japanese words are not separated by whitespaces.

After training, the tokenizer model was imported as transformers.BERTGenerationTokenizer because it supports SentencePiece models and it does not add any special tokens as default, which is useful expecially for a text generation task.

Training

The model was trained on the train set for 30 epochs with batch size 32. Each sample contained 1024 tokens.

We utilized Adam optimizer. Learning rate was linearly increased from 0 to 1e-4 during the first 10,000 steps. A clip norm was set to 1.0 .

Test set perplexity of the trained model was 29.13.

Please refer to GitHub for more training details.

Usage

First, install dependecies.

$ pip install transformers==4.10.0 torch==1.8.1 sentencepiece==0.1.96

Then use pipeline to generate sentences.

>>> import transformers
>>> pipeline = transformers.pipeline("text-generation", "colorfulscoop/gpt2-small-ja")
>>> pipeline("統計的機械学習でのニューラルネットワーク", do_sample=True, top_p=0.95, top_k=50, num_return_sequences=3)

Note: The default model configuration config.json sets parameters for text generation with do_sample=True , top_k=50 , top_p=0.95 . Please set these parameters when you need to use different parameters.

Versions

We recommend to specify revision to load the model for reproducibility.

Revision Date of Wikipedia dump
20210820.1.0 Aug 20, 2021
20210301.1.0 March 1, 2021

You can specify revision as follows.

# Example of pipeline
>>> transformers.pipeline("text-generation", "colorfulscoop/gpt2-small-ja", revision="20210820.1.0")
# Example of AutoModel
>>> transformers.AutoModel.from_pretrained("colorfulscoop/gpt2-small-ja", revision="20210820.1.0")
License

All the models included in this repository are licensed under Creative Commons Attribution-ShareAlike 3.0 .

Disclaimer: The model potentially has possibility that it generates similar texts in the training data, texts not to be true, or biased texts. Use of the model is at your sole risk. Colorful Scoop makes no warranty or guarantee of any outputs from the model. Colorful Scoop is not liable for any trouble, loss, or damage arising from the model output.

Author: Colorful Scoop

Runs of colorfulscoop gpt2-small-ja on huggingface.co

1.0K
Total runs
0
24-hour runs
10
3-day runs
-29
7-day runs
605
30-day runs

More Information About gpt2-small-ja huggingface.co Model

More gpt2-small-ja license Visit here:

https://choosealicense.com/licenses/cc

gpt2-small-ja huggingface.co

gpt2-small-ja huggingface.co is an AI model on huggingface.co that provides gpt2-small-ja's model effect (), which can be used instantly with this colorfulscoop gpt2-small-ja model. huggingface.co supports a free trial of the gpt2-small-ja model, and also provides paid use of the gpt2-small-ja. Support call gpt2-small-ja model through api, including Node.js, Python, http.

colorfulscoop gpt2-small-ja online free

gpt2-small-ja huggingface.co is an online trial and call api platform, which integrates gpt2-small-ja's modeling effects, including api services, and provides a free online trial of gpt2-small-ja, you can try gpt2-small-ja online for free by clicking the link below.

colorfulscoop gpt2-small-ja online free url in huggingface.co:

https://huggingface.co/colorfulscoop/gpt2-small-ja

gpt2-small-ja install

gpt2-small-ja is an open source model from GitHub that offers a free installation service, and any user can find gpt2-small-ja on GitHub to install. At the same time, huggingface.co provides the effect of gpt2-small-ja install, users can directly use gpt2-small-ja installed effect in huggingface.co for debugging and trial. It also supports api for free installation.

gpt2-small-ja install url in huggingface.co:

https://huggingface.co/colorfulscoop/gpt2-small-ja

Url of gpt2-small-ja

Provider of gpt2-small-ja huggingface.co

colorfulscoop
ORGANIZATIONS

Other API from colorfulscoop