-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Conversation
mark |
There was a problem hiding this 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): |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks for your contribution. |
更新offset mapping计算的方法,主要参考了https://github.com/bojone/bert4keras/blob/master/bert4keras/tokenizers.py#L372。