Downloads · 30 days
0
huggingface-course/albert-tokenizer-without-normalizer
albert-tokenizer-without-normalizer is a machine learning model from huggingface-course. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
The purpose of this repo is to show the usefulness of saving the normalization operation used during the tokenizer training
Downloads · 30 days
0
Access
Public
Updated Oct 19, 2021
Repo size
—
Likes
0
Public
Click a slice to open those files.
.json1.4 MB · 100%
From the Hugging Face model README
The purpose of this repo is to show the usefulness of saving the normalization operation used during the tokenizer training
from transformers import AutoTokenizer
text = "This is a text with àccënts and CAPITAL LETTERS"
tokenizer = AutoTokenizer.from_pretrained("albert-large-v2")
print(tokenizer.convert_ids_to_tokens(tokenizer.encode(text)))
# ['[CLS]', '▁this', '▁is', '▁a', '▁text', '▁with', '▁accent', 's', '▁and', '▁capital', '▁letters', '[SEP]']
tokenizer = AutoTokenizer.from_pretrained("huggingface-course/albert-tokenizer-without-normalizer")
print(tokenizer.convert_ids_to_tokens(tokenizer.encode(text)))
# ['[CLS]', '▁', '<unk>', 'his', '▁is', '▁a', '▁text', '▁with', '▁', '<unk>', 'cc', '<unk>', 'nts', '▁and', '▁', '<unk>', '▁', '<unk>', '[SEP]']