Following spacy's pipeline documentation I have been trying to use nlp.pipe pattern to speed up my pipeline. What I have found though is that for whatever batch_size I set there is no speed up compared to a sequential run.
I was wondering if the issue is on my end or if batching doesn't work?
I am testing this behaviour on 30000 texts which are on average 1500 characters long, I have tested batch sizes of 5,50,500,5000 with no avail.
So I timed:
for text in texts:
doc = nlp(text)
VS
doc_gen = nlp.pipe(texts, batch_size, n_threads)
With n_threads -1 & 2
Testing batch size 5, 50, 500, 5000
With texts containing 30000 documents with an average 1500 char length
My timing results don't show any significant difference between using the pipe pattern and not.
I am running Python 3 with spacy 2.0.12