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

[Ready] Reduce reload word tokenizer engine in word_tokenize #1064

Merged
merged 5 commits into from
Jan 13, 2025

Conversation

new5558
Copy link
Contributor

@new5558 new5558 commented Jan 11, 2025

What does this changes

Fixes #973

What was wrong

How this fixes it

Fixes #...

Your checklist for this pull request

  • Passed code styles and structures
  • Passed code linting checks and unit test
  • Test Attacut and icu manually
  • Benchmark speed improvement

@pep8speaks
Copy link

pep8speaks commented Jan 11, 2025

Hello @new5558! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻

Comment last updated at 2025-01-11 15:09:30 UTC

@coveralls
Copy link

coveralls commented Jan 11, 2025

Coverage Status

coverage: 52.795% (-0.04%) from 52.836%
when pulling d8d22f6 on new5558:dev
into 3aa57c6 on PyThaiNLP:dev.

@new5558 new5558 changed the title [WIP] Reduce reload word tokenizer engine in word_tokenize Reduce reload word tokenizer engine in word_tokenize Jan 11, 2025
@new5558
Copy link
Contributor Author

new5558 commented Jan 11, 2025

Manual test of Attacut & ICU tokenizers results and benchmark results can be found in this Colab Notebook

Performance Improvements

(Time per tokenizer function call)

Tokenizer Original (ms) This PR (ms) Original 50 threads (ms) This PR 50 threads (ms)
Attacut 9.83 ms 1.67 ms 17.18 ms 2.83 ms
ICU 0.03 ms 0.03 ms 0.19 ms 0.27 ms
Longest 0.02 ms 0.01 ms 0.21 ms 0.20 ms

Attacut engine is 6X Faster when tokenizing words "สวัสดี PythaiNLP".
Not much improvement in ICU and Longest engines,

@new5558 new5558 changed the title Reduce reload word tokenizer engine in word_tokenize [Ready] Reduce reload word tokenizer engine in word_tokenize Jan 11, 2025
Copy link
Member

@wannaphong wannaphong left a comment

Choose a reason for hiding this comment

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

Thank you! 💯

@wannaphong wannaphong merged commit ae4c5fa into PyThaiNLP:dev Jan 13, 2025
23 of 25 checks passed
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.

Reduce reload word tokenizer engine in word_tokenize
4 participants