(Validate component) ValueError: Invalid view ID

Hi,
I am getting the following error when I run:

prodigy db_ann ann_Test.jsonl --label GPE

I’m using prodigy v1.6.1 on Mac and the dataset format is correct because with the previous version it is working.

Traceback (most recent call last):
File “/usr/local/Cellar/python3/3.6.2/Frameworks/Python.framework/Versions/3.6/lib/python3.6/runpy.py”, line 193, in _run_module_as_main
main”, mod_spec)
File “/usr/local/Cellar/python3/3.6.2/Frameworks/Python.framework/Versions/3.6/lib/python3.6/runpy.py”, line 85, in _run_code
exec(code, run_globals)
File “/Users/lianet/erevalue/prodigy/prodigy_1.6/env3.6/lib/python3.6/site-packages/prodigy/main.py”, line 259, in
controller = recipe(*args, use_plac=True)
File “cython_src/prodigy/core.pyx”, line 264, in prodigy.core.recipe.recipe_decorator.recipe_proxy
File “cython_src/prodigy/core.pyx”, line 36, in prodigy.core.Controller.init
File “cython_src/prodigy/components/validate.pyx”, line 57, in prodigy.components.validate.Validator.init
File “cython_src/prodigy/components/validate.pyx”, line 42, in prodigy.components.validate.get_schema
ValueError: Not a valid view ID: ‘None’. Available options: text, classification, ner, ner_manual, pos, pos_manual, dep, image, image_manual, html, compare, diff, choice

I fixed the error setting validate:false in my prodigy.json

Any pointers are much appreciated.

This indicates that your custom recipe, db_ann, doesn't return a 'view_id' specifying the annotation interface to use. See here for a list of the available interfaces.

If you disable validation, the app will just default to whatever fits best to your data – but ideally, the recipe should specify how the content should be presented, to keep things consistent and predictable. You can add the view_id setting to the components returned by your recipe function like this:

return {
    'dataset': dataset,
    'stream': stream,
    # etc.
    'view_id': 'text'  # or whatever you want to use
}

Hi Ines, thanks a lot for your detailed answers. It’s working!

1 Like