Hi ,
I run that command "prodigy ner.teach sport_ner en_core_web_lg ../raw_data.jsonl --label SPORT --patterns gold_spanonlySPORT.jsonl" but got the error below. I used the annotations resulted from ner.make-gold which has only the spans this time. But I got the invalid pattern error again.
Using 1 labels: SPORT
Traceback (most recent call last):
File "/Users/../lib/python3.7/runpy.py", line 193, in _run_module_as_main "main", mod_spec)
File "/Users/../lib/python3.7/runpy.py", line 85, in _run_code exec(code, run_globals)
File "/Users/../lib/python3.7/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 "/Users/../lib/python3.7/site-packages/plac_core.py", line 328, in call
cmd, result = parser.consume(arglist)
File "/Users/../lib/python3.7/site-packages/plac_core.py", line 207, in consume
return cmd, self.func((args + varargs + extraopts), **kwargs)
File "/Users/../lib/python3.7/site-packages/prodigy/recipes/ner.py", line 143, in teach
matcher = PatternMatcher(model.nlp).from_disk(patterns)
File "cython_src/prodigy/models/matcher.pyx", line 209, in prodigy.models.matcher.PatternMatcher.from_disk
File "cython_src/prodigy/models/matcher.pyx", line 136, in prodigy.models.matcher.PatternMatcher.add_patterns
File "cython_src/prodigy/models/matcher.pyx", line 60, in prodigy.models.matcher.create_matchers
File "cython_src/prodigy/models/matcher.pyx", line 29, in prodigy.models.matcher.parse_patterns
ValueError: Invalid pattern: ['Ski Equipment', {'entities': [[0, 3, 'SPORT']]}]
Could you please help me to understand how can I use the annotations that I got from ner.make-gold for the ner.teach train and later on for ner.batch-train?
The pattern gold_spanonlySPORT.jsonl look like:
["Fishing",{"entities":[[0,7,"SPORT"]]}]
["Football",{"entities":[[0,8,"SPORT"]]}]
["Go-karting",{"entities":[[0,10,"SPORT"]]}]
["Golf",{"entities":[[0,4,"SPORT"]]}]
["Hockey",{"entities":[[0,6,"SPORT"]]}]
["Horse trekking",{"entities":[[0,14,"SPORT"]]}]
["Horse riding",{"entities":[[0,12,"SPORT"]]}]
["Hot air ballooning",{"entities":[[0,18,"SPORT"]]}]
["Jet biking",{"entities":[[0,10,"SPORT"]]}]