How to add reject examples in a multi-labeled training data?

Hi,
I have a piece of text which has different labels annotated in the spans. i have an ‘accept’ tag after all of them are rightly tagged. How do i add a reject example here? what format? my data looks like this.

{“id”:“41de84d38633fe7b431c74091b5dcef1”,“text”:“Replaced TDS wash pipe and pressure tested same to 100 bar / 10 minutes. Meanwhile changed leaking hydraulic fittings on elevators.”,“spans”:[{“start”:9,“end”:12,“token_start”:1,“token_end”:1,“label”:“Equipment”},{“start”:13,“end”:22,“token_start”:2,“token_end”:3,“label”:“Equipment”},{“start”:36,“end”:42,“token_start”:6,“token_end”:6,“label”:“Action”},{“start”:92,“end”:99,“token_start”:18,“token_end”:18,“label”:“Equipment Problem”},{“start”:100,“end”:109,“token_start”:19,“token_end”:19,“label”:“Equipment”},{“start”:122,“end”:131,“token_start”:22,“token_end”:22,“label”:“Equipment”}],"_input_hash":1212946672,"_task_hash":-506802127,“tokens”:[{“text”:“Replaced”,“start”:0,“end”:8,“id”:0},{“text”:“TDS”,“start”:9,“end”:12,“id”:1},{“text”:“wash”,“start”:13,“end”:17,“id”:2},{“text”:“pipe”,“start”:18,“end”:22,“id”:3},{“text”:“and”,“start”:23,“end”:26,“id”:4},{“text”:“pressure”,“start”:27,“end”:35,“id”:5},{“text”:“tested”,“start”:36,“end”:42,“id”:6},{“text”:“same”,“start”:43,“end”:47,“id”:7},{“text”:“to”,“start”:48,“end”:50,“id”:8},{“text”:“100”,“start”:51,“end”:54,“id”:9},{“text”:“bar”,“start”:55,“end”:58,“id”:10},{“text”:"/",“start”:59,“end”:60,“id”:11},{“text”:“10”,“start”:61,“end”:63,“id”:12},{“text”:“minutes”,“start”:64,“end”:71,“id”:13},{“text”:".",“start”:71,“end”:72,“id”:14},{“text”:" “,“start”:73,“end”:74,“id”:15},{“text”:“Meanwhile”,“start”:74,“end”:83,“id”:16},{“text”:“changed”,“start”:84,“end”:91,“id”:17},{“text”:“leaking”,“start”:92,“end”:99,“id”:18},{“text”:“hydraulic”,“start”:100,“end”:109,“id”:19},{“text”:“fittings”,“start”:110,“end”:118,“id”:20},{“text”:“on”,“start”:119,“end”:121,“id”:21},{“text”:“elevators”,“start”:122,“end”:131,“id”:22},{“text”:”.",“start”:131,“end”:132,“id”:23}],“answer”:“accept”}

I could add reject examples for single label training data. just find some random word apart from the tagged ones and say reject. but not very sre about reject examples in multilabel. (or does it learn label A is a negative example of label B?)

I’m not 100% sure I understand your question correctly. You’re training a named entity recognition model, right?

If you’ve labelled the data manually and all entities you need are in the data, you don’t necessarily need negative examples. You can also just run ner.batch-train and set the --no-missing flag, which will tell spaCy to treat the examples as complete gold-standard annotations with no missing values.

Thank you. I am using the “–no-missing” flag. Yes, i am doing a ner - new entity training. Just wanted to conform if i was doing it right. Thank you for the immediate response, i appreciate it.

1 Like