load_vocab | R Documentation |
Load a vocabulary file
load_vocab(vocab_file)
vocab_file |
path to vocabulary file. File is assumed to be a text file, with one token per line, with the line number corresponding to the index of that token in the vocabulary. |
In the BERT Python code, the vocab is returned as an OrderedDict from the collections package. Here we return the vocab as a named integer vector. Names are tokens in vocabulary, values are integer indices.
## Not run: vocab <- load_vocab(vocab_file = "vocab.txt") ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.