MCPcopy Create free account
hub / github.com/brightmart/text_classification / tokenize

Method tokenize

a00_Bert/tokenization.py:119–125  ·  view source on GitHub ↗
(self, text)

Source from the content-addressed store, hash-verified

117 self.wordpiece_tokenizer = WordpieceTokenizer(vocab=self.vocab)
118
119 def tokenize(self, text):
120 split_tokens = []
121 for token in self.basic_tokenizer.tokenize(text):
122 for sub_token in self.wordpiece_tokenizer.tokenize(token):
123 split_tokens.append(sub_token)
124
125 return split_tokens
126
127 def convert_tokens_to_ids(self, tokens):
128 return convert_by_vocab(self.vocab, tokens)

Callers 2

convert_single_exampleFunction · 0.45
convert_single_exampleFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected