I am having a hard time getting the entity linking demo here to work.
From what I am seeing I am guessing it has to do with it using old versions of spacy and/or prodigy.
I managed to fairly easily fix one problem where the scripts are callling "KnowledgeBase" and Spacy complained that it was an abstract class. I replaced instances of "KnowledgeBase with "InMemoryLookupKB" and that seemed to work fine.
More worryingly, when I try to run the recipe, I get:
prodigy entity_linker.manual emersons_annotated assets/emerson_input_text.txt my_output/my_nlp/ my_output/my_kb assets/entities.csv -F scripts/el_recipe.py
/Users/alan/.pyenv/versions/3.8.18/lib/python3.8/site-packages/spacy/util.py:910: UserWarning: [W095] Model 'en_core_web_lg' (3.5.0) was trained with spaCy v3.5.0 and may not be 100% compatible with the current version (3.7.4). If you see errors or degraded performance, download a newer compatible model or retrain your custom model with the current spaCy version. For more details and available updates, run: python -m spacy validate
warnings.warn(warn_msg)
Traceback (most recent call last):
File "/Users/alan/.pyenv/versions/3.8.18/lib/python3.8/runpy.py", line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/Users/alan/.pyenv/versions/3.8.18/lib/python3.8/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/Users/alan/.pyenv/versions/3.8.18/lib/python3.8/site-packages/prodigy/__main__.py", line 50, in <module>
main()
File "/Users/alan/.pyenv/versions/3.8.18/lib/python3.8/site-packages/prodigy/__main__.py", line 44, in main
controller = run_recipe(run_args)
File "cython_src/prodigy/cli.pyx", line 123, in prodigy.cli.run_recipe
File "cython_src/prodigy/cli.pyx", line 124, in prodigy.cli.run_recipe
File "scripts/el_recipe.py", line 44, in entity_linker_manual
model = EntityRecognizer(nlp)
File "spacy/pipeline/ner.pyx", line 198, in spacy.pipeline.ner.EntityRecognizer.__init__
TypeError: __init__() takes at least 2 positional arguments (1 given)
Any idea what the problem is here? I looked around the docs and in support tickets, and I saw this line being used without comment, so I am not sure what might have changed recently?
I have:
spacy==3.7.4
prodigy==1.15.0
I have tried using an older version of spacy but I had trouble installing it.
It would be so nice to update this demo since it is really useful!