How to make spacy lemmatization process fast?
https://spacy.io/api/lemmatizer just uses lookup tables and the only upstream task it relies on is POS tagging, so it should be relatively fast. For large amounts of text, SpaCy recommends using nlp.pipe, which can work in batches and has built in support for multiprocessing (with the n_process keyword), rather than than simply nlp.
Also, make sure you disable any pipeline elements that you don't plan to use, as they'll just waste processing time. If you're only doing lemmatization, you'll pass disable=[&quot;parser&quot;, &quot;ner&quot;] to the nlp.pipe call.
Example code that takes all of the above into account is below.
import spacy
nlp = spacy.load(&quot;en_core_web_sm&quot;)

docs = [&quot;We've been running all day.&quot;, &quot;Let's be better.&quot;]

for doc in nlp.pipe(docs, batch_size=32, n_process=3, disable=[&quot;parser&quot;, &quot;ner&quot;]):
    print([tok.lemma_ for tok in doc])

# ['-PRON-', 'have', 'be', 'run', 'all', 'day', '.']
# ['let', '-PRON-', 'be', 'well', '.']
```