Last active
March 14, 2020 16:33
-
-
Save khuangaf/b5ff454a45061342611a8028f7a1ad3b to your computer and use it in GitHub Desktop.
Revisions
-
khuangaf revised this gist
Mar 14, 2020 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,3 @@ tokenizer = BertTokenizer.from_pretrained('bert-base-uncased') tokens = tokenizer.tokenize('Learn Hugging Face Transformers & BERT with PyTorch in 5 Minutes') tokens = ['[CLS]'] + tokens + ['[SEP]'] -
khuangaf created this gist
Mar 14, 2020 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,3 @@ tokenizer = BertTokenizer.from_pretrained('bert-base-uncased') tokens = tokenizer.tokenize('Learn Hugging Face Transformers & BERT with PyTorch in 5 Minutes') input_ids = tokenizer.convert_tokens_to_ids(tokens)