Initially asked this question but moving to this forum .
I have a custom recipe for annotating relation extraction annotations. The rel.manual recipe has an argument to add entities to the incoming text by adding the argument --add-ents
. However I cant figure out how to apply this to a custom recipe.
To call the recipe I would run
prodigy rel_ext con_rel -F scripts/cust_id.py
and it works in that I can start annotating, but there are no entities so I really cant annotate the relations.
My first thought was to try adding the argument for the rel.manual recipe to the command for a custom recipe.
prodigy rel_ext con_rel -F scripts/cust_id.py --add-ents
But this creates the following error.
usage: prodigy rel_ext [-h] dataset [view_id]
prodigy rel_ext: error: unrecognized arguments: --add-ents
Is there a place you can add that argument, or are there hooks in the custom recipe to specify the custom recipe uses that argument. What I ended up doing was to create a function in the in the recipe to do this
stream = get_stream()
stream = add_tokens(nlp, stream)
stream = add_ents_to_stream(nlp, stream)
But it seems like there should be a way to use the --add-ents argument which likely does something similar to the add_ents_to_stream function that gets defined in this recipe. It seems like it would be more complicated for arguments like --patterns to implement those as a defined function in the recipe.