Skip to content

Commit

Permalink
Add DeprecationWarning to ser.str.subword_tokenize (#8603)
Browse files Browse the repository at this point in the history
This PR adds deprecationWarning to `ser.str.subword_tokenize` .

Checkout related issue for details:  #8604

Authors:
  - Vibhu Jawa (https://github.com/VibhuJawa)

Approvers:
  - GALI PREM SAGAR (https://github.com/galipremsagar)

URL: #8603
  • Loading branch information
VibhuJawa authored Jul 8, 2021
1 parent b123eb8 commit a5427d2
Showing 1 changed file with 11 additions and 0 deletions.
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

0 comments on commit a5427d2

Please sign in to comment.