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

How can I speed up Simplemma for Polish? #8

Closed
rafaelsaback opened this issue Feb 21, 2022 · 2 comments
Closed

How can I speed up Simplemma for Polish? #8

rafaelsaback opened this issue Feb 21, 2022 · 2 comments

Comments

@rafaelsaback
Copy link

First of all, thank you for creating this great lemmatizer!

I've used it for English and it's blazing fast (in my trials, it found the lemma in less than 10 ms). For other languages, such as Portuguese and Spanish it's still reasonably fast, with lemmatization working under 50ms.

For Polish, however, lemmatization is taking over 2 seconds. I know Polish is a more complicated language for lemmatizing because it's inflected, but is there a way I can speed it up? Ideally, I'd like to have it below 100ms, but even under 500ms I think it would be good enough.

In my trials, I'm passing a single word and doing it simply like this:

import  simplemma
import time

start = time.time()
langdata = simplemma.load_data('pl')
print(simplemma.lemmatize('robi', langdata))
end = time.time()
print(end-start)
@1over137
Copy link
Contributor

I believe much of this time is spent loading the data. langdata is essentially a dict that is loaded from a big file. You can try lemmatizing 100k words to see how long it takes. It is quite fast for most needs if you pre-load the necessary data.

@rafaelsaback
Copy link
Author

Awesome, you're 100%! After loading the langData, getting the lemma is really fast. I'll preload them. Thanks for the insight.

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

No branches or pull requests

2 participants