Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
transformers
Commits
3c39c07f
Unverified
Commit
3c39c07f
authored
Nov 25, 2022
by
SaulLu
Committed by
GitHub
Nov 25, 2022
Browse files
fix `word_to_tokens` docstring format (#20450)
* fix docstring * fix 2 * add details
parent
a547d5bd
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
src/transformers/tokenization_utils_base.py
src/transformers/tokenization_utils_base.py
+4
-2
No files found.
src/transformers/tokenization_utils_base.py
View file @
3c39c07f
...
@@ -475,8 +475,10 @@ class BatchEncoding(UserDict):
...
@@ -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
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment