Closed vitaly-d closed 1 year ago
Thanks for the report, I'm surprised this hasn't come up sooner!
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
spacy.ngram_suggester.v1
andspacy.ngram_range_suggester.v1
suggesters don't seem to be compatible with multiprocessing: it fails withAttributeError: Can't pickle local object 'build_ngram_suggester.<locals>.ngram_suggester'
.How to reproduce the behaviour
the
spancat_multiprocessing_fail.py
script from the attached spancat_multiprocessing.zip fails withAttributeError: Can't pickle local object 'build_ngram_suggester.<locals>.ngram_suggester'
Workaround
the
spancat_multiprocessing_ok.py
script works. It contains 'custom' suggester that is a copy of https://github.com/explosion/spaCy/blob/372a90885e849a286c27103bece93ad8a02c842e/spacy/pipeline/spancat.py#L86 wrapped in a python class.Info about spaCy