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

Method cls_token_id

bert/tokenization_utils_base.py:854–858  ·  view source on GitHub ↗

Id of the classification token in the vocabulary. E.g. to extract a summary of an input sequence leveraging self-attention along the full depth of the model. Log an error if used while not having been set.

(self)

Source from the content-addressed store, hash-verified

852
853 @property
854 def cls_token_id(self):
855 """ Id of the classification token in the vocabulary. E.g. to extract a summary of an input sequence leveraging self-attention along the full depth of the model. Log an error if used while not having been set. """
856 if self._cls_token is None:
857 return None
858 return self.convert_tokens_to_ids(self.cls_token)
859
860 @property
861 def mask_token_id(self):

Callers

nothing calls this directly

Calls 1

convert_tokens_to_idsMethod · 0.80

Tested by

no test coverage detected