Created
June 27, 2020 08:39
-
-
Save prateekjoshi565/f893b034cbf7271e77ce749afb9a9896 to your computer and use it in GitHub Desktop.
This file contains 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 characters
# initialize tokenizer | |
tokenizer = BertWordPieceTokenizer("bert-base-uncased-vocab.txt") | |
# sample sentence | |
sentence = "Language is a thing of beauty. But mastering a new language from scratch is quite a daunting prospect." | |
# tokenize the sample sentence | |
encoded_output = tokenizer.encode(sentence) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment