prodigy.serve('ner.manual') problems

Hello,

I’m trying into a container to run in python a prodigy.serve ‘ner.manual’ instance.

there is my code :

import prodigy
prodigy.serve(‘ner.manual’, ‘test_entities’, ‘fr_core_news_sm’, ‘/work/data_entities.jsonl’, [‘TAUX_HUM’, ‘DATE_RDV’, ‘PJ’], host=‘0.0.0.0’, port=‘8081’)

It throws this error :
TypeError: unhashable type: ‘list’

And if i specify label=[’…’,’…] :

It works, but it didnt take my array in label parameter.

UPDATE:

I tried a third possibility : without ‘[]’

See screenshot:

Can you tell me how can i launch a ner.manual session in a python script simply ?

Thanks a lot

Maxime

Hi! It looks like you were doing everything right, except for one thing: As you can see in the error message, Prodigy raises an error in the loaders telling you the your labels aren’t a valid loader. This means you’ve accidentally passed in the labels where Prodigy expects the name of a file/API loader.

When you call prodigy.serve, the recipe arguments have to be passed in as positional arguments in order. For ner.manual, those arguments are: dataset, spacy_model, source, api, loader, label. So if you don’t want to specify an api or a loader, you’ll have to pass in None here:

 prodigy.serve('ner.manual', 'test_entities', 'fr_core_news_sm', 
               '/work/data_entities.jsonl', None, None, 
               ['TAUX_HUM', 'DATE_RDV', 'PJ'], host='0.0.0.0', port=8081)