I used ner.teach
to annotate a bunch of data to improve the NER model. I then ran ner.batch-train
on it, and successfully updated and saved the new model. When I turn around and try to use the new model in ner.teach
, I get the following error:
ahalterman$ prodigy ner.teach ner_db ner_model brazil2.jsonl --label LOC,GPE
Traceback (most recent call last):
File "/Users/ahalterman/anaconda3/lib/python3.6/runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "/Users/ahalterman/anaconda3/lib/python3.6/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/Users/ahalterman/anaconda3/lib/python3.6/site-packages/prodigy/__main__.py", line 238, in <module>
controller = recipe(*args, use_plac=True)
File "cython_src/prodigy/core.pyx", line 143, in prodigy.core.recipe.recipe_decorator.recipe_proxy
File "cython_src/prodigy/util.pyx", line 173, in prodigy.util.suggest_view_id
File "/Users/ahalterman/anaconda3/lib/python3.6/site-packages/toolz/itertoolz.py", line 368, in first
return next(iter(seq))
File "cython_src/prodigy/components/sorters.pyx", line 127, in __iter__
File "cython_src/prodigy/components/sorters.pyx", line 53, in genexpr
File "cython_src/prodigy/models/ner.pyx", line 215, in __call__
File "cython_src/prodigy/models/ner.pyx", line 185, in get_tasks
File "cytoolz/itertoolz.pyx", line 1046, in cytoolz.itertoolz.partition_all.__next__ (cytoolz/itertoolz.c:14538)
File "cython_src/prodigy/models/ner.pyx", line 151, in predict_spans
File "cytoolz/itertoolz.pyx", line 1046, in cytoolz.itertoolz.partition_all.__next__ (cytoolz/itertoolz.c:14538)
File "cython_src/prodigy/components/preprocess.pyx", line 12, in split_sentences
File "/Users/ahalterman/anaconda3/lib/python3.6/site-packages/spacy/language.py", line 531, in pipe
for doc, context in izip(docs, contexts):
File "/Users/ahalterman/anaconda3/lib/python3.6/site-packages/spacy/language.py", line 554, in pipe
for doc in docs:
File "nn_parser.pyx", line 369, in pipe
File "cytoolz/itertoolz.pyx", line 1046, in cytoolz.itertoolz.partition_all.__next__ (cytoolz/itertoolz.c:14538)
File "nn_parser.pyx", line 369, in pipe
File "cytoolz/itertoolz.pyx", line 1046, in cytoolz.itertoolz.partition_all.__next__ (cytoolz/itertoolz.c:14538)
File "pipeline.pyx", line 395, in pipe
File "cytoolz/itertoolz.pyx", line 1046, in cytoolz.itertoolz.partition_all.__next__ (cytoolz/itertoolz.c:14538)
File "/Users/ahalterman/anaconda3/lib/python3.6/site-packages/spacy/language.py", line 710, in _pipe
for doc in docs:
File "/Users/ahalterman/anaconda3/lib/python3.6/site-packages/spacy/language.py", line 534, in <genexpr>
docs = (self.make_doc(text) for text in texts)
File "/Users/ahalterman/anaconda3/lib/python3.6/site-packages/spacy/language.py", line 357, in make_doc
return self.tokenizer(text)
File "tokenizer.pyx", line 80, in spacy.tokenizer.Tokenizer.__call__
TypeError: object of type 'NoneType' has no len()
What’s puzzling is that I can load and use the new model with spaCy without any trouble. Any thoughts?