I thought I'd run these models side-by-side to see how they compare. It turns out, though, that spacy won't let you load two pipelines that each define a factory with the same name (seems like an odd choice to me, but who am I?)
ValueError: [E004] Can't set up pipeline component: a factory for 'sdoh_cui' already exists. Existing factory: <class 'en_sdoh_bow_cui.postprocess.SDOH'>. New factory: <class 'en_sdoh_cnn_ner_cui.postprocess.SDOH'>
So, to fix this in my install, I went into the saved spacy models (at $PYTHON_PACKAGE_PATH/en_sdoh_bow_cui/ and $PYTHON_PACKAGE_PATH/en_sdoh_cnn_ner_cui/) and changed all references to the sdoh_cui factory to be either sdoh_cui_bow or sdoh_cui_cnn, respectively. Might be worth making that change on the repository so that it works for other users.
I thought I'd run these models side-by-side to see how they compare. It turns out, though, that spacy won't let you load two pipelines that each define a factory with the same name (seems like an odd choice to me, but who am I?)
You get errors like this :
ValueError: [E004] Can't set up pipeline component: a factory for 'sdoh_cui' already exists. Existing factory: <class 'en_sdoh_bow_cui.postprocess.SDOH'>. New factory: <class 'en_sdoh_cnn_ner_cui.postprocess.SDOH'>
So, to fix this in my install, I went into the saved spacy models (at
$PYTHON_PACKAGE_PATH/en_sdoh_bow_cui/
and$PYTHON_PACKAGE_PATH/en_sdoh_cnn_ner_cui/
) and changed all references to thesdoh_cui
factory to be eithersdoh_cui_bow
orsdoh_cui_cnn
, respectively. Might be worth making that change on the repository so that it works for other users.Also see this discussion on the spacy repo