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

compute the list of punctuation characters only once. #67

Merged
merged 1 commit into from
Sep 6, 2022

Conversation

f4hy
Copy link
Contributor

@f4hy f4hy commented Sep 6, 2022

The values from unicodedata should never change, so this will be a
constant value. On my machine this iterates over 1,114,112 elements to
compute the list. We don't need to recompute this every time and can
save the results of the punctuation characters so only the first time
a RemovePunctuation transform will take time and future calls will
reuse the character list.

Closes #66

The values from `unicodedata` should never change, so this will be a
constant value. On my machine this iterates over 1,114,112 elements to
compute the list. We don't need to recompute this every time and can
save the results of the punctuation characters so only the first time
a RemovePunctuation transform will take time and future calls will
reuse the character list.
@jitsi-jenkins
Copy link

Hi, thanks for your contribution!
If you haven't already done so, could you please make sure you sign our CLA (https://jitsi.org/icla for individuals and https://jitsi.org/ccla for corporations)? We would unfortunately be unable to merge your patch unless we have that piece :(.

@nikvaessen nikvaessen merged commit a15a472 into jitsi:master Sep 6, 2022
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.

Major performance regression in 2.5.0 for jiwer.transforms.RemovePunctuation
3 participants