-
Notifications
You must be signed in to change notification settings - Fork 928
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
New nvtext::wordpiece_tokenizer APIs #17600
Open
davidwendt
wants to merge
95
commits into
rapidsai:branch-25.04
Choose a base branch
from
davidwendt:wordpiece-tokenize
base: branch-25.04
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
+1,872
−10
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
…wordpiece-tokenize
…wordpiece-tokenize
/ok to test |
/ok to test |
3 tasks
rapids-bot bot
pushed a commit
that referenced
this pull request
Feb 12, 2025
Recent build failure in #17600 indicated undefined `std::iota`. This PR adds the appropriate `#include <numeric>` in the source files where this is called. Authors: - David Wendt (https://github.com/davidwendt) - Nghia Truong (https://github.com/ttnghia) Approvers: - Bradley Dice (https://github.com/bdice) - Yunsong Wang (https://github.com/PointKernel) - Muhammad Haseeb (https://github.com/mhaseeb123) URL: #17983
/ok to test |
Adding reference here to issue #12403 as well. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
3 - Ready for Review
Ready for review by team
CMake
CMake build issue
feature request
New feature or request
libcudf
Affects libcudf (C++/CUDA) code.
non-breaking
Non-breaking change
pylibcudf
Issues specific to the pylibcudf package
Python
Affects Python cuDF API.
strings
strings issues (C++ and Python)
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Creates a new word-piece-tokenizer which replaces the existing subword-tokenizer in nvtext.
The subword-tokenizer logic is to split out and specialized to perform basic tokenizing with the word-piece logic only.
The normalizing part is already a separate API. The output will be a lists column of tokens only.
The first change is that the new API uses
wordpiece
instead ofsubword
. Here are the 2 C++ API declarations:The vocabulary is loaded as a strings column and the returned object can be used on multiple calls to the next API:
This will return a lists column of integers which represent the tokens for each row. The
max_words_per_row
will stop the tokenizing process for each row once the number of input words (characters delimited by space) has been reached. This means you may get more tokens thanmax_words_per_row
for a row if a single word produces multiple tokens.Note, that this API expects the input string to already be normalized -- processed by the
nvtext::normalize_characters
API which is also being reworked in #17818The Python interface has the following pattern:
The output is a lists column of the tokens and no longer the tensor-data and metadata format.
If this format is needed, then we can consider a 3rd API that converts the output here to that format.
Closes #17507
Checklist