medspacy / PyRuSH

init
MIT License
3 stars 2 forks source link

Medspacy cannot set up pipeline component: factory for pyrush already exists. #1

Closed redur closed 2 years ago

redur commented 2 years ago

Hi all,

since the recent update to 1.0.4 my medspacy pipelines don't work any more.

On import medspacy I get the error: import medspacy File "/usr/lib/python3.7/site-packages/medspacy/__init__.py", line 6, in <module> from . import components File "/usr/lib/python3.7/site-packages/medspacy/components.py", line 12, in <module> from .sentence_splitting import PyRuSHSentencizer File "/usr/lib/python3.7/site-packages/medspacy/sentence_splitting.py", line 10, in <module> def create_pyrush(nlp, name, pyrush_path=None): File "/usr/local/lib64/python3.7/site-packages/spacy/language.py", line 482, in add_factory raise ValueError(err) ValueError: [E004] Can't set up pipeline component: a factory for 'medspacy_pyrush' already exists. Existing factory: <class 'PyRuSH.PyRuSHSentencizer.PyRuSHSentencizer'>. New factory: <function create_pyrush at 0x7f8a4dbcae60>

When reverting to 1.0.3.6 the error disappears.

Relevant spacy versions installed: medspacy==0.2.0.0 spacy==3.2.3

Happy to provide more information if needed.

Thanks!

jianlins commented 2 years ago

We are updating all the medspacy components to accommodate spaCy 3.0 API. It's working in progress. Please specify the pip install -I medspacy PyRuSH==1.0.3.6 instead atm.