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

Wordpiece tokenizer #111

Merged
merged 7 commits into from
Feb 4, 2021
Merged

Wordpiece tokenizer #111

merged 7 commits into from
Feb 4, 2021

Conversation

pogren
Copy link
Member

@pogren pogren commented Feb 1, 2021

Description

An implementation of the Wordpiece tokenizer that is consistent with Huggingface implementation.

Motivation

This is useful for tokenizing text in Java so that we can have word ids that are consistent with BERT models built using Wordpiece-built vocabularies.

Copy link
Member

@Craigacp Craigacp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small things. I'd like wordpiece to be more immutable, and WordpieceTokenizer needs to implement clone(). The rest is just tidying up and adding comments & copyright.

- additionally, fixed an issue with the neverSplit strings.
- copyrights, javadocs, config params, etc.
Copy link
Member

@Craigacp Craigacp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are a few typos, and the clone method on WordpieceTokenizer needs some more work.

Copy link
Member

@Craigacp Craigacp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks.

@Craigacp Craigacp merged commit a10ec50 into main Feb 4, 2021
@Craigacp Craigacp deleted the wordpiece-tokenizer branch February 9, 2021 20:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants