prodigy v1.8 start the web app from Python for recipe textcat.manual

I used this code to run the app from python but it giving me errors:

prodigy.serve("textcat.manual",
"esg_tagged_test",
"en_core_web_lg",
"./ESG_classifications_analystA.jsonl",
None,
["ESG", "Not_ESG", "Confused"],
True,
None,
port=9000)

it's giving the following error:

\lib\site-packages\prodigy\recipes\textcat.py in manual(dataset, spacy_model, source, api, loader, label, exclusive, exclude)
127 log("RECIPE: Loaded model {}".format(spacy_model))
128 labels = label
--> 129 has_options = len(labels) > 1
130 log("RECIPE: Annotating with {} labels".format(len(labels)), labels)
131 stream = get_stream(

TypeError: object of type 'bool' has no len()

Can anyone tell me what's the correct syntax. I am using prodigy v'1.8.3'

Hi!

If I match the arguments to the textcat.manual method, it looks like you've forgotten the argument for api or for loader. Right now, True is being parsed as the argument for label (instead of your intended list) so this seems to be where the error comes from.

Does it work if you call

prodigy.serve("textcat.manual",
"esg_tagged_test",
"en_core_web_lg",
"./ESG_classifications_analystA.jsonl",
None,
None,
["ESG", "Not_ESG", "Confused"],
True,
None,
port=9000)

instead?

2 Likes

Thanks this worked.