GLiNER icon indicating copy to clipboard operation
GLiNER copied to clipboard

gliner spacy import (gliner_spacy) broken

Open ddofer opened this issue 1 year ago • 3 comments

Running the code in the example notebook (https://github.com/urchade/GLiNER/blob/main/examples/gliner_spacy_demo.ipynb) fails.

`--------------------------------------------------------------------------- ModuleNotFoundError Traceback (most recent call last) Cell In[5], line 3 1 import spacy 2 from gliner import GLiNER ----> 3 from gliner_spacy.pipeline import GlinerSpacy

ModuleNotFoundError: No module named 'gliner_spacy'`

Either the example code or the package's code seems broken? (Importing GLiNER works, and spacy with other things also works)

ddofer avatar Nov 05 '24 09:11 ddofer

Additionally, running the next cell in the example notebook also breaks;

`import spacy from gliner import GLiNER

nlp = spacy.load("en_core_web_sm") nlp.add_pipe("gliner_spacy")`

ValueError: [E002] Can't find factory for 'gliner_spacy' for language English (en). This usually happens when spaCy calls nlp.create_pipe with a custom component name that's not registered on the current language class. If you're using a custom component, make sure you've added the decorator @Language.component (for function components) or @Language.factory (for class components).

ddofer avatar Nov 05 '24 09:11 ddofer

I'm not affiliated with the GLiNER project, but I assume you've installed the glincer_spacy module?

pip install gliner-spacy

https://github.com/theirstory/gliner-spacy

DomHudson avatar Nov 19 '24 16:11 DomHudson

Hello. I maintain gliner-spaCy. As @DomHudson pointed out, you need to install gliner-spacy separately for it to work.

wjbmattingly avatar Mar 16 '25 21:03 wjbmattingly