Hello ines, thanks for your quick response !
I believe that I use the latest version of prodigy 1.8.3.
$ prodigy stats
? Prodigy stats
Version 1.8.3
Location C:\WORKSPACE\ENV\lib\site-packages\prodigy
Prodigy Home C:\WORKSPACE.prodigy
Platform Windows-10-10.0.17134-SP0
Python Version 3.7.2
Database Name SQLite
Database Id sqlite
Total Datasets 1
Total Sessions 48
$ python make_blank_ner_model.py
import spacy
from spacy.pipeline import EntityRecognizer
nlp = spacy.load('en_core_web_lg')
ner = nlp.create_pipe("ner")
nlp.replace_pipe("ner", ner)
nlp.to_disk('blank_ner_en_core_web_lg')
$ prodigy ner.match 3_ner blank_ner_en_core_web_lg email_rows.jsonl -pt patterns.jsonl
Traceback (most recent call last):
File "C:\WORKSPACE\AppData\Local\Programs\Python\Python37\Lib\runpy.py", line 193, in run_module_as_main
"main", mod_spec)
File "C:\WORKSPACE\AppData\Local\Programs\Python\Python37\Lib\runpy.py", line 85, in run_code
exec(code, run_globals)
File "C:\WORKSPACE\ENV\lib\site-packages\prodigy_main.py", line 380, in
controller = recipe(args, use_plac=True)
File "cython_src\prodigy\core.pyx", line 212, in prodigy.core.recipe.recipe_decorator.recipe_proxy
File "C:\WORKSPACE\ENV\lib\site-packages\plac_core.py", line 328, in call
cmd, result = parser.consume(arglist)
File "C:\WORKSPACE\ENV\lib\site-packages\plac_core.py", line 207, in consume
return cmd, self.func((args + varargs + extraopts), **kwargs)
File "C:\WORKSPACE\ENV\lib\site-packages\prodigy\recipes\ner.py", line 64, in match
model = PatternMatcher(spacy.load(spacy_model)).from_disk(patterns)
File "C:\WORKSPACE\ENV\lib\site-packages\spacy_init.py", line 27, in load
return util.load_model(name, **overrides)
File "C:\WORKSPACE\ENV\lib\site-packages\spacy\util.py", line 133, in load_model
return load_model_from_path(Path(name), **overrides)
File "C:\WORKSPACE\ENV\lib\site-packages\spacy\util.py", line 173, in load_model_from_path
return nlp.from_disk(model_path)
File "C:\WORKSPACE\ENV\lib\site-packages\spacy\language.py", line 791, in from_disk
util.from_disk(path, deserializers, exclude)
File "C:\WORKSPACE\ENV\lib\site-packages\spacy\util.py", line 630, in from_disk
reader(path / key)
File "C:\WORKSPACE\ENV\lib\site-packages\spacy\language.py", line 787, in
deserializers[name] = lambda p, proc=proc: proc.from_disk(p, exclude=["vocab"])
File "nn_parser.pyx", line 629, in spacy.syntax.nn_parser.Parser.from_disk
File "nn_parser.pyx", line 54, in spacy.syntax.nn_parser.Parser.Model
TypeError: Model() takes exactly 1 positional argument (0 given)
This works:
$ prodigy ner.match 3_ner en_core_web_lg email_rows.jsonl -pt patterns.jsonl
? Starting the web server at http://localhost:8080 ...
Open the app in your browser and start annotating!
This also does not work, same error stack as above:
$ prodigy ner.teach 3_ner blank_ner_en_core_web_lg email_rows.jsonl --label MV,VESSEL,DWT -U
My guess is that my only ner empty model with replaced empty ner pipe is not created properly.
So in your code, youâd only have to call nlp.remove_pipe("ner")
Ines, do you mean that I should create a custom recipe for that ?