Syntax error with prodigy.serve

What is wrong with this call from the handbook:

prodigy.serve("ner.manual ner_news_headlines en_core_web_sm ./news_headlines.jsonl --label PERSON,ORG", port=9000)

The cl-call is working but with prodigy.serve it complains "Syntax error"

Which version of Prodigy are you using? Note that the new CLI-like syntax was only added in v1.9 – see the docs for details.

I just tried your command locally and it worked fine for me. Maybe double-check where the syntax error is raised and if it's within the serve function, or somewhere else?

i use the current version 1.9.6.

I'll make further research, maybe it depends of the jupyter environment.

If i do the call fom a Terminal inside the jupyter env it doesn't work (Syntax error) but the same call with prodigy but without "serve" and without capsulating the params works fine.

Same behaviour in a notebook:

/bin/sh: 1: Syntax error: word unexpected (expecting ")")

This definitely looks like the problem is in your code / Jupyter cell and not within Prodigy. In fact, the error seems to be a bash error and not a Python error. So maybe you're accidentally running that piece of Python code as a terminal command?

twice, i call from Terminal and from a notebook cell also. Both the same result.

And yes, indeed - it is a bash error if i call from a Terminal.


If you run Python code within bash, that's expected. If you want to run Prodigy from a terminal / from bash, you can use the regular command line commands. If you want to run it from Python with prodigy.serve, you should use a Python interpreter.

thanks, i got it!