MCPcopy Create free account
hub / github.com/SooLab/CGFormer / _convert_id_to_token

Method _convert_id_to_token

bert/tokenization_bert.py:223–225  ·  view source on GitHub ↗

Converts an index (integer) in a token (str) using the vocab.

(self, index)

Source from the content-addressed store, hash-verified

221 return self.vocab.get(token, self.vocab.get(self.unk_token))
222
223 def _convert_id_to_token(self, index):
224 """Converts an index (integer) in a token (str) using the vocab."""
225 return self.ids_to_tokens.get(index, self.unk_token)
226
227 def convert_tokens_to_string(self, tokens):
228 """ Converts a sequence of tokens (string) in a single string. """

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected