MCPcopy Create free account
hub / github.com/tensorflow/models / tokenize

Method tokenize

official/nlp/tools/tokenization.py:177–183  ·  view source on GitHub ↗
(self, text)

Source from the content-addressed store, hash-verified

175 self.wordpiece_tokenizer = WordpieceTokenizer(vocab=self.vocab)
176
177 def tokenize(self, text):
178 split_tokens = []
179 for token in self.basic_tokenizer.tokenize(text):
180 for sub_token in self.wordpiece_tokenizer.tokenize(token):
181 split_tokens.append(sub_token)
182
183 return split_tokens
184
185 def convert_tokens_to_ids(self, tokens):
186 return convert_by_vocab(self.vocab, tokens)

Callers 15

test_full_tokenizerMethod · 0.95
make_paragraphFunction · 0.45
callMethod · 0.45
callMethod · 0.45
_tokenizeMethod · 0.45
test_cased_length10Method · 0.45
_improve_answer_spanFunction · 0.45
_tokenizeMethod · 0.45

Calls

no outgoing calls

Tested by 4

test_full_tokenizerMethod · 0.76
test_cased_length10Method · 0.36