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

Update Offset mapping #882

Merged
merged 2 commits into from
Aug 25, 2021
Merged

Update Offset mapping #882

merged 2 commits into from
Aug 25, 2021

Conversation

JunnYu
Copy link
Member

@JunnYu JunnYu commented Aug 14, 2021

更新offset mapping计算的方法,主要参考了https://github.com/bojone/bert4keras/blob/master/bert4keras/tokenizers.py#L372。

@yingyibiao
Copy link
Contributor

mark

@ZeyuChen ZeyuChen changed the title fix #880 Update Offset mapping Aug 19, 2021
@ZeyuChen ZeyuChen added this to In progress in PaddleNLP 2.1 via automation Aug 24, 2021
PaddleNLP 2.1 automation moved this from In progress to Review in progress Aug 24, 2021
Copy link
Contributor

@smallv0221 smallv0221 left a comment

Choose a reason for hiding this comment

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

Excellent work! Only a few small problems.

@@ -1390,6 +1344,47 @@ def get_input_ids(text):

return batch_encode_inputs

def rematch(self, text):
Copy link
Contributor

Choose a reason for hiding this comment

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

Is the name get_offset_mapping better?

@@ -1390,6 +1344,47 @@ def get_input_ids(text):

return batch_encode_inputs

def rematch(self, text):
"""
changed from https://github.com/bojone/bert4keras/blob/master/bert4keras/tokenizers.py#L372
Copy link
Contributor

Choose a reason for hiding this comment

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

PaddleNLP 2.1 automation moved this from Review in progress to Reviewer approved Aug 25, 2021
@smallv0221
Copy link
Contributor

LGTM! Thanks for your contribution.

@smallv0221 smallv0221 merged commit 582b4ca into PaddlePaddle:develop Aug 25, 2021
PaddleNLP 2.1 automation moved this from Reviewer approved to Done Aug 25, 2021
@JunnYu JunnYu deleted the fix#880 branch August 30, 2021 04:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

3 participants