Edit model card
YAML Metadata Warning: empty or missing yaml metadata in repo card (https://huggingface.co/docs/hub/model-cards#model-card-metadata)

説明

ごく少量の日本語テキストで作った、テスト用のトークナイザーです。

学習に使ったデータサイズ

日本語:545KB

設定

vocab_size=32,000(語彙サイズ)
character_coverage=0.9995(文字のカバー率99.95%)
model_type="BPE"(アルゴリズム)
normalization="identity"(正規化なし)
byte_fallback=True(バイト変換あり)
split_digits=True(数字分割あり)
allow_whitespace_only_pieces=True(空白のトークンを許可する)
remove_extra_whitespaces=True(余分な空白の削除あり)

使い方

!pip install transformers>=4.34.0

from transformers import T5Tokenizer
test_tokenizer = T5Tokenizer.from_pretrained("geniacllm/ucllm-test-tokenizer-bpe")
# text
text = "今日はいい天気ですね。"

# tokenize
tokenized = test_tokenizer.tokenize(text)
print(tokenized)
# 出力:['今日は', 'いい', '天', '気', 'ですね', '。']

# encode
encoded = test_tokenizer.encode(text)
print(encoded)
# 出力:[5130, 448, 30475, 30024, 1650, 29966, 2]

# decode
decoded = test_tokenizer.decode(encoded)
print(decoded)
# 出力:今日はいい天気ですね。</s>

# special_token
print(test_tokenizer.special_tokens_map)
# 出力:{'bos_token': '<s>', 'eos_token': '</s>', 'unk_token': '<unk>', 'sep_token': '<SEP>', 'pad_token': '<pad>', 'cls_token': '<CLS>', 'mask_token': '<MASK>', 'additional_special_tokens': ['<EOD>']}

# vocab size
print(len(test_tokenizer))
# 出力:32000

# all subwords in vocab
print(test_tokenizer.get_vocab())
# 出力:{'<unk>': 0, '<s>': 1, '</s>': 2, '<pad>': 3, '<CLS>': 4, '<SEP>': 5, …(以下略)
Downloads last month

-

Downloads are not tracked for this model. How to track
Unable to determine this model's library. Check the docs .

Collection including geniacllm/test-tokenizer-bpe