Example choice recipe doesn't work

On https://prodi.gy/docs/workflow-custom-recipes the recipe for the customer feedback sentiment example errors with this error:

Traceback (most recent call last):
  File "/usr/lib/python3.5/runpy.py", line 184, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.5/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/home/sean/.virtualenvs/prodigy-_xPorgpA/lib/python3.5/site-packages/prodigy/__main__.py", line 242, in <module>
    controller = recipe(*args, use_plac=True)
  File "cython_src/prodigy/core.pyx", line 150, in prodigy.core.recipe.recipe_decorator.recipe_proxy
  File "/home/sean/.virtualenvs/prodigy-_xPorgpA/lib/python3.5/site-packages/plac_core.py", line 324, in call
    parser = parser_from(obj)
  File "/home/sean/.virtualenvs/prodigy-_xPorgpA/lib/python3.5/site-packages/plac_core.py", line 133, in parser_from
    parser.populate_from(obj)
  File "/home/sean/.virtualenvs/prodigy-_xPorgpA/lib/python3.5/site-packages/plac_core.py", line 257, in populate_from
    a = Annotation.from_(ann)
  File "/home/sean/.virtualenvs/prodigy-_xPorgpA/lib/python3.5/site-packages/plac_core.py", line 91, in from_
    return cls(*obj)
  File "/home/sean/.virtualenvs/prodigy-_xPorgpA/lib/python3.5/site-packages/plac_core.py", line 78, in __init__
    assert abbrev is None, abbrev
AssertionError: None

In order to get it to work, I had to change file_path=("Path to texts", "positional", "None", str)) to file_path=("Path to texts", "positional", None, str)) (note the difference between β€œNone” and None).

Ah, stupid typo – thanks a lot! Fixing! Fixed! :+1:

@ines : Looks like we could also stand to fix this same issue in the docs for customizing recipe arguments:

I can confirm that using that pseudocode with "None" instead of None throws the same error listed above, and applying the fix you noted resolves the issue.

Thanks, that's also a typo! Fixed and should be live in a few mins :slightly_smiling_face:

1 Like