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

Fix NPTag preprocess bug #2199

Merged
merged 2 commits into from
May 17, 2022
Merged

Fix NPTag preprocess bug #2199

merged 2 commits into from
May 17, 2022

Conversation

linjieccc
Copy link
Contributor

@linjieccc linjieccc commented May 17, 2022

PR types

Bug fixes

PR changes

APIs

Description

tokenizer非兼容升级导致NPTag解码错误:

from paddlenlp.transformers import AutoTokenizer

tokens = list('糖醋排骨')
tokenizer = AutoTokenizer.from_pretrained('ernie-1.0')
tokenizer(tokens, return_length=True, is_split_into_words=True, pad_to_max_seq_len=True, max_seq_len=64)

升级前结果返回的是padding前的序列长度:{..., 'seq_len': 6}
升级后结果返回的是padding前的序列长度:{..., 'seq_len': 64}

已修改为不做padding,返回原始序列长度的方式

@ZeyuChen ZeyuChen merged commit 7ca4114 into PaddlePaddle:develop May 17, 2022
@linjieccc linjieccc deleted the fix_nptag branch June 1, 2022 10:06
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.

3 participants