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 FNet Preprocessor #646

Merged
merged 4 commits into from
Jan 13, 2023
Merged

Conversation

abheesht17
Copy link
Collaborator

@abheesht17 abheesht17 commented Jan 10, 2023

super().__init__(proto=proto, **kwargs)

# Check for necessary special tokens.
cls_token = "[CLS]"
Copy link
Member

Choose a reason for hiding this comment

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

This is odd, they really mix special tokens styles like this?

I guess this is half BERT style, half sentencepiece defaults.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah, I verified it with HF's tokenizer output

@abheesht17 abheesht17 mentioned this pull request Jan 12, 2023
Copy link
Member

@mattdangerw mattdangerw left a comment

Choose a reason for hiding this comment

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

Just one nit!

- Pack the inputs together using a `keras_nlp.layers.MultiSegmentPacker`.
with the appropriate `"[CLS]"`, `"[SEP]"` and `"<pad>"` tokens.
- Construct a dictionary with keys `"token_ids"`, `"segment_ids"` and
`"padding_mask"`, that can be passed directly to
Copy link
Member

Choose a reason for hiding this comment

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

there is no "padding_mask" right?

@mattdangerw mattdangerw merged commit 3a951a9 into keras-team:master Jan 13, 2023
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