Skip to content

Instantly share code, notes, and snippets.

@hanneshapke
Created March 9, 2020 16:55
Show Gist options
  • Save hanneshapke/ef38bd445097d5002972812237fd7622 to your computer and use it in GitHub Desktop.
Save hanneshapke/ef38bd445097d5002972812237fd7622 to your computer and use it in GitHub Desktop.
import tensorflow_text as text
vocab_file_path = bert_layer.resolved_object.vocab_file.asset_path.numpy()
do_lower_case = bert_layer.resolved_object.do_lower_case.numpy()
bert_tokenizer = text.BertTokenizer(
vocab_lookup_table=vocab_file_path,
token_out_type=tf.int64,
lower_case=do_lower_case
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment