Answers for "how to add special token to bert tokenizer"

1

how to add special token to bert tokenizer

special_tokens_dict = {'additional_special_tokens': ['[C1]','[C2]','[C3]','[C4]']}
num_added_toks = tokenizer.add_special_tokens(special_tokens_dict)
model.resize_token_embeddings(len(tokenizer))
Posted by: Guest on January-21-2021

Code answers related to "how to add special token to bert tokenizer"

Python Answers by Framework

Browse Popular Code Answers by Language