A recipe to correct NER labels from annotated offsets rather than suggested by a spaCy model

I am sure I've seen it somewhere, but can't figure it now. Is there a simple way to review and amend annotated (NER) examples using offset annotations?

For example:

Instead of the collected wrong annotation:

{"text": 'A cat drives Porsche', "spans": [{'start':2, 'end': 5, 'label':'ANIMAL'}, {'start':13, 'end': 20, 'label':'ANIMAL'}]

I can upload it to Prodigy and correct the label of the last entity and save:

{"text": 'A cat drives Porsche', "spans": [{'start':2, 'end': 5, 'label':'ANIMAL'}, {'start':13, 'end': 20, 'label':'CAR'}]

Thanks!

P.S. I tried review recipe with --view-id option, but I was not able to make any changes.

Hi! I think the easiest solution would be to load your data into ner.manual. The recipe respects pre-defined entities and will take care of mapping them to tokens. You'll then be able to see the prehighlighted spans, and correct them if needed.

If you have multiple conflicting annotations on the same data, the review recipe is a nice way to reconcile them and create one final "master annotation". However, if you want the spans to be editable, you'll need to load in datasets with the ner_manual view ID and make sure it's pre-tokenized. If you're just using the ner interface, the spans won't be editable and all you get to annotate is the accept/reject decision.

1 Like