Bug Report: Error in recipe or function for Openai NER V3?

I've been strugging to run prodigy with spacy-llm and few shot examples for an NER problem. I can't seem to resolve how to combine all the options needed at the command line.. but I stepped back to trying just the recipe code given in your folder here:

https://github.com/explosion/spacy-llm/tree/main/usage_examples/ner_v3_openai,

and that recipe fails for me with:

File "/home/lcherny/code/labeling/run_pipeline.py", line 29, in <module>
    typer.run(run_pipeline)

  File "/home/lcherny/code/labeling/run_pipeline.py", line 21, in run_pipeline
    nlp = assemble(config_path, overrides={"paths.examples": str(examples_path)})

  File "/opt/conda/envs/spacyllm/lib/python3.10/site-packages/spacy_llm/util.py", line 47, in assemble
    config = load_config(config_path, overrides=overrides, interpolate=False)

  File "/opt/conda/envs/spacyllm/lib/python3.10/site-packages/spacy/util.py", line 715, in load_config
    return config.from_disk(

  File "/opt/conda/envs/spacyllm/lib/python3.10/site-packages/confection/__init__.py", line 488, in from_disk
    return self.from_str(text, interpolate=interpolate, overrides=overrides)

  File "/opt/conda/envs/spacyllm/lib/python3.10/site-packages/confection/__init__.py", line 417, in from_str
    self._set_overrides(config, overrides)

  File "/opt/conda/envs/spacyllm/lib/python3.10/site-packages/confection/__init__.py", line 389, in _set_overrides
    raise ConfigValidationError(errors=err, title=err_title)

confection.ConfigValidationError:

Error parsing config overrides
paths -> examples	not a section value that can be overridden

My command line usage was > python run_pipeline.py "very long text string here" spacy-llm-config.cfg (pointing to gpt4 and few shot) ner-examples.json (as per the repo directions?). Spacy-llm 0.6.4

I just ran this command from a fresh env, and it worked.

> dotenv run -- python run_pipeline.py "Oh no! My chocolates!" fewshot.cfg examples.json 
Text: Oh no! My chocolates!
Entities: [('chocolates', 'INGREDIENT')]

I have tried spacy.GPT-3-5.v1,spacy.GPT-4.v1, spacy.GPT-4.v2 and spacy.GPT-4.v3 which all ran without issue. Is it possible that you're not using the "spacy.NER.v3" task?

In this case, if the issue persists, it might be better to post this issue on the Github repo for the project. This issue seems mostly related to spaCy-LLM and less related to Prodigy.

Hmm, will do. I just realized when I looked for similar cases that the repo was the right place. Sorry.

1 Like

No worries :slight_smile: !