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

[BugFix] Deal with greek letter "sigma" when return offset_mapping #2897

Merged
merged 7 commits into from
Jul 29, 2022

Conversation

yingyibiao
Copy link
Contributor

PR types

Bug fixes

PR changes

Models

Description

Fix #2854

@yingyibiao
Copy link
Contributor Author

#2854

@@ -1363,7 +1363,13 @@ def get_offset_mapping(self, text):
if token in self.all_special_tokens:
token = token.lower() if hasattr(
self, "do_lower_case") and self.do_lower_case else token
start = text[offset:].index(token) + offset
# Deal with special greek letter with 2 forms (sigma)
Copy link
Contributor

Choose a reason for hiding this comment

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

可以加个特殊处理的说明,例如:
“The greek letter "sigma" has 2 types of lowercase. When used at the end of a letter-case word (one that does not use all caps), the final form (ς) is used. Otherwise, the form (σ) is used”

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@yingyibiao yingyibiao merged commit 8292c71 into PaddlePaddle:develop Jul 29, 2022
@yingyibiao yingyibiao deleted the tokenizer branch July 29, 2022 09:48
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.

Taskflow做信息抽取报错:substring not found
3 participants