File size: 288 Bytes
2c81ba8 | 1 2 3 4 5 6 7 8 9 10 | from transformers import AutoTokenizer
model_checkpoint = "distilbert-base-uncased"
tokenizer = AutoTokenizer.from_pretrained(model_checkpoint)
def tokenize(batch):
return tokenizer(batch["text"], truncation=True, padding="max_length")
tokenized = data.map(tokenize, batched=True)
|