Update encode documentation (#4751)

This commit is contained in:
Lysandre Debut
2020-06-03 16:30:59 -04:00
committed by GitHub
parent ed4df85572
commit 2e4de76231

View File

@@ -1377,9 +1377,10 @@ class PreTrainedTokenizer(SpecialTokensMixin):
**kwargs
):
"""
Converts a string in a sequence of ids (integer), using the tokenizer and vocabulary.
Converts a string in a sequence of ids (integer), using the tokenizer and vocabulary. Adds the model-specific
special tokens (such as beginning of sequence, end of sequence, sequence separator).
Same as doing ``self.convert_tokens_to_ids(self.tokenize(text))``.
If specifying ``add_special_tokens=False``, same as doing ``self.convert_tokens_to_ids(self.tokenize(text))``.
Args:
text (:obj:`str`, :obj:`List[str]` or :obj:`List[int]`):