Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add DeprecationWarning to ser.str.subword_tokenize #8603

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions python/cudf/cudf/core/column/string.py
Original file line number Diff line number Diff line change
Expand Up @@ -4620,6 +4620,9 @@ def subword_tokenize(
This function requires about 21x the number of character bytes
in the input strings column as working memory.

``ser.str.subword_tokenize`` will be depreciated in future versions.
Use ``cudf.core.subword_tokenizer.SubwordTokenizer`` instead.

Parameters
----------
hash_file : str
Expand Down Expand Up @@ -4691,6 +4694,14 @@ def subword_tokenize(
array([[0, 0, 2],
[1, 0, 1]], dtype=uint32)
"""
warning_message = (
"`ser.str.subword_tokenize` API will be depreciated"
" in future versions of cudf.\n"
"Use `cudf.core.subword_tokenizer.SubwordTokenizer` "
"instead"
)

warnings.warn(warning_message, FutureWarning)
tokens, masks, metadata = cpp_subword_tokenize_vocab_file(
self._column,
hash_file,
Expand Down