I was looking at the post: "
NER annotations format with positives and negatives examples
" (Oct 19).
The question posed was if the format
{"text":"cat is an animal and so is dog, while sandwich is not.",
"spans": [{"start": 0, "end": 3, "label": "ANIMAL"},{"start": 27, "end": 30, "label": "ANIMAL"},{"start": 38, "end": 46, "label": "ANIMAL"}],
"answer":["accept","accept","reject"]
}
is OK.
Ines replied that:
"You can keep the top-level answer as
"accept"
, but add an additional"answer"
to each span in the"spans"
. Alternatively, you could also duplicate the example and create one 3 versions: one for each span and then a top-level answer."
So according to Ines if we would like all the examples to be considered as negative then the example should be formatted as follows?
{"text":"cat is an animal and so is dog, while sandwich is not.",
"spans": [{"start": 0, "end": 3, "label": "ANIMAL", 'answer' : 'accept'},{"start": 27, "end": 30, "label": "ANIMAL", 'answer' : '},{"start": 38, "end": 46, "label": "ANIMAL"}],
"answer": "reject"
}
And a last question: Can we use this format of examples if we want to train a model using the training loop?
Or the possibility to add negative examples (i.e. "answer" : "reject") exists only when we train our model using a Prodigy recipe?