richardpaulhudson / coreferee

Coreference resolution for English, French, German and Polish, optimised for limited training data and easily extensible for further languages
MIT License
102 stars 16 forks source link

ModelNotSupportedError: spaCy model en_coreference_web_trf version 3.4.0a2 is not supported by Coreferee. #28

Closed ByUnal closed 1 year ago

ByUnal commented 1 year ago

I followed the instructions, but It doesn't work. I'm getting the same error everytime ,and there is nothing left that I didn't try for fixing it.

Here is my spacy info:

image

And here is the my environment's versions:

coreferee==1.4.1
coreferee-model-en @ https://github.com/richardpaulhudson/coreferee/raw/master/models/coreferee_model_en.zip#sha256=aec5662b4af38fbf4b8c67e4aada8b828c51d4a224b5e08f7b2b176c02d8780f

spacy==3.4.4
spacy-alignments==0.9.0
spacy-experimental==0.6.2
spacy-legacy==3.0.12
spacy-loggers==1.0.4
spacy-transformers==1.1.9

What is wrong here ? It is so annoying. I really need this module.

Complete error below:

✘ spaCy model en_coreference_web_trf version 3.4.0a2 is not supported
by Coreferee. Please examine /coreferee/lang/en/config.cfg to see the supported
models/versions.
---------------------------------------------------------------------------
ModelNotSupportedError                    Traceback (most recent call last)
Cell In[5], line 2
      1 nlp_corr = spacy.load("en_coreference_web_trf")
----> 2 nlp_corr.add_pipe('coreferee')

File ~/anaconda3/envs/cihat/lib/python3.10/site-packages/spacy/language.py:801, in Language.add_pipe(self, factory_name, name, before, after, first, last, source, config, raw_config, validate)
    793     if not self.has_factory(factory_name):
    794         err = Errors.E002.format(
    795             name=factory_name,
    796             opts=", ".join(self.factory_names),
   (...)
    799             lang_code=self.lang,
    800         )
--> 801     pipe_component = self.create_pipe(
    802         factory_name,
    803         name=name,
    804         config=config,
    805         raw_config=raw_config,
    806         validate=validate,
    807     )
    808 pipe_index = self._get_pipe_index(before, after, first, last)
    809 self._pipe_meta[name] = self.get_factory_meta(factory_name)

File ~/anaconda3/envs/cihat/lib/python3.10/site-packages/spacy/language.py:680, in Language.create_pipe(self, factory_name, name, config, raw_config, validate)
    677 cfg = {factory_name: config}
    678 # We're calling the internal _fill here to avoid constructing the
    679 # registered functions twice
--> 680 resolved = registry.resolve(cfg, validate=validate)
    681 filled = registry.fill({"cfg": cfg[factory_name]}, validate=validate)["cfg"]
    682 filled = Config(filled)

File ~/anaconda3/envs/cihat/lib/python3.10/site-packages/confection/__init__.py:728, in registry.resolve(cls, config, schema, overrides, validate)
    719 @classmethod
    720 def resolve(
    721     cls,
   (...)
    726     validate: bool = True,
    727 ) -> Dict[str, Any]:
--> 728     resolved, _ = cls._make(
    729         config, schema=schema, overrides=overrides, validate=validate, resolve=True
    730     )
    731     return resolved

File ~/anaconda3/envs/cihat/lib/python3.10/site-packages/confection/__init__.py:777, in registry._make(cls, config, schema, overrides, resolve, validate)
    775 if not is_interpolated:
    776     config = Config(orig_config).interpolate()
--> 777 filled, _, resolved = cls._fill(
    778     config, schema, validate=validate, overrides=overrides, resolve=resolve
    779 )
    780 filled = Config(filled, section_order=section_order)
    781 # Check that overrides didn't include invalid properties not in config

File ~/anaconda3/envs/cihat/lib/python3.10/site-packages/confection/__init__.py:849, in registry._fill(cls, config, schema, validate, resolve, parent, overrides)
    846     getter = cls.get(reg_name, func_name)
    847     # We don't want to try/except this and raise our own error
    848     # here, because we want the traceback if the function fails.
--> 849     getter_result = getter(*args, **kwargs)
    850 else:
    851     # We're not resolving and calling the function, so replace
    852     # the getter_result with a Promise class
    853     getter_result = Promise(
    854         registry=reg_name, name=func_name, args=args, kwargs=kwargs
    855     )

File ~/anaconda3/envs/cihat/lib/python3.10/site-packages/coreferee/manager.py:140, in CorefereeBroker.__init__(self, nlp, name)
    138 self.nlp = nlp
    139 self.pid = os.getpid()
--> 140 self.annotator = CorefereeManager().get_annotator(nlp)

File ~/anaconda3/envs/cihat/lib/python3.10/site-packages/coreferee/manager.py:132, in CorefereeManager.get_annotator(nlp)
    118 error_msg = "".join(
    119     (
    120         "spaCy model ",
   (...)
    129     )
    130 )
    131 msg.fail(error_msg)
--> 132 raise ModelNotSupportedError(error_msg)

ModelNotSupportedError: spaCy model en_coreference_web_trf version 3.4.0a2 is not supported by Coreferee. Please examine /coreferee/lang/en/config.cfg to see the supported models/versions.
ByUnal commented 1 year ago

Sorry, it was my bad. I should have used en_core_web_trf instead of en_coreference_web_trf. Code works fine now.