fix word_to_tokens docstring format (#20450)
* fix docstring * fix 2 * add details
This commit is contained in:
@@ -475,8 +475,10 @@ class BatchEncoding(UserDict):
|
|||||||
or 1) the provided word index belongs to.
|
or 1) the provided word index belongs to.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
Optional [`~tokenization_utils_base.TokenSpan`] Span of tokens in the encoded sequence. Returns `None` if
|
([`~tokenization_utils_base.TokenSpan`], *optional*): Span of tokens in the encoded sequence. Returns
|
||||||
no tokens correspond to the word.
|
`None` if no tokens correspond to the word. This can happen especially when the token is a special token
|
||||||
|
that has been used to format the tokenization. For example when we add a class token at the very beginning
|
||||||
|
of the tokenization.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
if not self._encodings:
|
if not self._encodings:
|
||||||
|
|||||||
Reference in New Issue
Block a user