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