scossin / iamsystem_python

Fast dictionary-based approach for semantic annotation / entity linking
MIT License
6 stars 1 forks source link

Can't change spacy component name: RecursionError: maximum recursion depth exceeded while calling a Python object #20

Closed scossin closed 1 year ago

scossin commented 1 year ago
from iamsystem.spacy.component import IAMsystemBuildSpacy

nlp = spacy.blank("fr")
nlp.add_pipe(
    "iamsystem_matcher",
    name="iamsystem2",
    last=True,
    config={"build_params": {"keywords": ["cancer"]}},
)
doc = nlp("prostate cancer")

The iamsystem component must be disabled when the tokenizer is called, since the component name 'iamsystem' was hard coded here: https://github.com/scossin/iamsystem_python/blob/294f6d3a29dac4e4656f72a5ef839f81d27cce7b/src/iamsystem/spacy/tokenizer.py#L35 ; it is called recursively, causing this error.