explosion / healthsea

Healthsea is a spaCy pipeline for analyzing user reviews of supplementary products for their effects on health.
MIT License
88 stars 16 forks source link

ValueError: [E853] Unsupported component factory name 'healthsea.aggregation.v1'. The character '.' is not permitted in factory names. #9

Open Researcher-123 opened 1 year ago

Researcher-123 commented 1 year ago

These are the errors I get when I run this code:

import spacy

nlp = spacy.load("en_healthsea")
doc = nlp("This is great for joint pain")
print(doc._.health_effects)

These errors happen when I install spaCy 3.4.4

ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
en-healthsea 0.0.1 requires spacy<3.3.0,>=3.2.0, but you have spacy 3.4.4 which is incompatible.
Traceback (most recent call last):
  File "/home/my_pc/scispaCy/spaCy lessons/Entity_recognition.py", line 24, in <module>
    nlp = spacy.load("en_healthsea")
  File "/home/vasya/.local/lib/python3.10/site-packages/spacy/__init__.py", line 54, in load
    return util.load_model(
  File "/home/vasya/.local/lib/python3.10/site-packages/spacy/util.py", line 432, in load_model
    return load_model_from_package(name, **kwargs)  # type: ignore[arg-type]
  File "/home/vasya/.local/lib/python3.10/site-packages/spacy/util.py", line 467, in load_model_from_package
    cls = importlib.import_module(name)
  File "/usr/lib/python3.10/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/home/vasya/.local/lib/python3.10/site-packages/en_healthsea/__init__.py", line 4, in <module>
    from . import clause_aggregation
  File "/home/vasya/.local/lib/python3.10/site-packages/en_healthsea/clause_aggregation.py", line 6, in <module>
    @Language.factory("healthsea.aggregation.v1")
  File "/home/vasya/.local/lib/python3.10/site-packages/spacy/language.py", line 470, in factory
    raise ValueError(Errors.E853.format(name=name))
ValueError: [E853] Unsupported component factory name 'healthsea.aggregation.v1'. The character '.' is not permitted in factory names.

These errors happen when I install spaCy 3.2.0

ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
spacy-transformers 1.1.9 requires spacy<4.0.0,>=3.4.0, but you have spacy 3.2.0 which is incompatible.
en-core-web-sm 3.4.1 requires spacy<3.5.0,>=3.4.0, but you have spacy 3.2.0 which is incompatible.
en-core-web-md 3.4.1 requires spacy<3.5.0,>=3.4.0, but you have spacy 3.2.0 which is incompatible.
en-core-web-lg 3.4.1 requires spacy<3.5.0,>=3.4.0, but you have spacy 3.2.0 which is incompatible.
Traceback (most recent call last):
  File "/home/my_pc/scispaCy/spaCy lessons/Entity_recognition.py", line 24, in <module>
    nlp = spacy.load("en_healthsea")
  File "/home/vasya/.local/lib/python3.10/site-packages/spacy/__init__.py", line 51, in load
    return util.load_model(
  File "/home/vasya/.local/lib/python3.10/site-packages/spacy/util.py", line 420, in load_model
    return load_model_from_package(name, **kwargs)  # type: ignore[arg-type]
  File "/home/vasya/.local/lib/python3.10/site-packages/spacy/util.py", line 453, in load_model_from_package
    return cls.load(vocab=vocab, disable=disable, exclude=exclude, config=config)  # type: ignore[attr-defined]
  File "/home/vasya/.local/lib/python3.10/site-packages/en_healthsea/__init__.py", line 14, in load
    return load_model_from_init_py(__file__, **overrides)
  File "/home/vasya/.local/lib/python3.10/site-packages/spacy/util.py", line 615, in load_model_from_init_py
    return load_model_from_path(
  File "/home/vasya/.local/lib/python3.10/site-packages/spacy/util.py", line 488, in load_model_from_path
    nlp = load_model_from_config(config, vocab=vocab, disable=disable, exclude=exclude)
  File "/home/vasya/.local/lib/python3.10/site-packages/spacy/util.py", line 525, in load_model_from_config
    nlp = lang_cls.from_config(
  File "/home/vasya/.local/lib/python3.10/site-packages/spacy/language.py", line 1755, in from_config
    nlp = lang_cls(vocab=vocab, create_tokenizer=create_tokenizer, meta=meta)
  File "/home/vasya/.local/lib/python3.10/site-packages/spacy/language.py", line 162, in __init__
    util.registry._entry_point_factories.get_all()
  File "/home/vasya/.local/lib/python3.10/site-packages/catalogue/__init__.py", line 119, in get_all
    result.update(self.get_entry_points())
  File "/home/vasya/.local/lib/python3.10/site-packages/catalogue/__init__.py", line 134, in get_entry_points
    result[entry_point.name] = entry_point.load()
  File "/usr/lib/python3.10/importlib/metadata/__init__.py", line 171, in load
    module = import_module(match.group('module'))
  File "/usr/lib/python3.10/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 992, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/home/vasya/.local/lib/python3.10/site-packages/spacy_transformers/__init__.py", line 1, in <module>
    from . import architectures
  File "/home/vasya/.local/lib/python3.10/site-packages/spacy_transformers/architectures.py", line 6, in <module>
    from .layers import TransformerModel, TransformerListener
  File "/home/vasya/.local/lib/python3.10/site-packages/spacy_transformers/layers/__init__.py", line 1, in <module>
    from .listener import TransformerListener
  File "/home/vasya/.local/lib/python3.10/site-packages/spacy_transformers/layers/listener.py", line 4, in <module>
    from ..data_classes import TransformerData
  File "/home/vasya/.local/lib/python3.10/site-packages/spacy_transformers/data_classes.py", line 12, in <module>
    from .util import transpose_list
  File "/home/vasya/.local/lib/python3.10/site-packages/spacy_transformers/util.py", line 9, in <module>
    from thinc.api import get_torch_default_device
ImportError: cannot import name 'get_torch_default_device' from 'thinc.api' (/home/vasya/.local/lib/python3.10/site-packages/thinc/api.py)
Ali-MH-Mansour commented 11 months ago

The same with me.