Skip to content

Instantly share code, notes, and snippets.

@khuangaf
Last active March 14, 2020 16:33
Show Gist options
  • Save khuangaf/b5ff454a45061342611a8028f7a1ad3b to your computer and use it in GitHub Desktop.
Save khuangaf/b5ff454a45061342611a8028f7a1ad3b to your computer and use it in GitHub Desktop.
BERT tokenization
tokenizer = BertTokenizer.from_pretrained('bert-base-uncased')
tokens = tokenizer.tokenize('Learn Hugging Face Transformers & BERT with PyTorch in 5 Minutes')
tokens = ['[CLS]'] + tokens + ['[SEP]']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment