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

説明

wikipediaデータで学習したトークナイザー。

学習に使ったデータ

英語:1.21GB
wiki40b-enから一部抽出したものを使用。

引用元

設定

vocab_size=32,000(語彙サイズ)
character_coverage=0.9995(文字のカバー率99.95%)
model_type="unigram"(アルゴリズム)
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/en-tokenizer-unigram-v1")
# text
text = "This is tokenizer test."

# tokenize
tokenized = test_tokenizer.tokenize(text)
print(tokenized)

# encode
encoded = test_tokenizer.encode(text)
print(encoded)

# decode
decoded = test_tokenizer.decode(encoded)
print(decoded)

# special_token
print(test_tokenizer.special_tokens_map)


# vocab size
print(len(test_tokenizer))

# all subwords in vocab
print(test_tokenizer.get_vocab())
Downloads last month
0
Unable to determine this model's library. Check the docs .

Collection including geniacllm/en-tokenizer-unigram-v1