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

[TIP] 2x speed improvement with one changed line #77

Open
ldorigo opened this issue Oct 11, 2021 · 0 comments
Open

[TIP] 2x speed improvement with one changed line #77

ldorigo opened this issue Oct 11, 2021 · 0 comments

Comments

@ldorigo
Copy link
Contributor

ldorigo commented Oct 11, 2021

Hi, I don't have time to make a PR right now, this is just to let you know that simply excluding NER from the spacy pipeline results in approximately 2x speed (at least when processing lots of short sentences).

You can do so by replacing line 158 of core.py from

            self.nlp = spacy.load(spacy_lang)

to

            self.nlp = spacy.load(spacy_lang, exclude=["ner"])

And most likely, you could also add a separate case (like self.nlp_nosyntax = spacy.load(spacy_lang, exclude=[...])) for matching without syntax where you can exclude most other components as well and get an even larger speedup.

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

1 participant