mirror of
				https://github.com/explosion/spaCy.git
				synced 2025-10-31 16:07:41 +03:00 
			
		
		
		
	Hack scorer to avoid evaluating non-nered data
This commit is contained in:
		
							parent
							
								
									70bd7fb611
								
							
						
					
					
						commit
						359e874766
					
				|  | @ -371,11 +371,12 @@ class Scorer(object): | |||
|                 self.ner_per_ents[ent_label] = PRFScore() | ||||
|         # Find all candidate labels, for all and per type | ||||
|         gold_ents = set() | ||||
|         cand_ents = set() | ||||
|         if gold_doc.is_nered: | ||||
|             for ent in gold_doc.ents: | ||||
|                 gold_ent = (ent.label_, ent.start, ent.end - 1) | ||||
|                 gold_ents.add(gold_ent) | ||||
|                 gold_per_ents[ent.label_].add((ent.label_, ent.start, ent.end - 1)) | ||||
|         cand_ents = set() | ||||
|             cand_per_ents = {ent_label: set() for ent_label in ent_labels} | ||||
|             for ent in doc.ents: | ||||
|                 first = align.cand_to_gold[ent.start] | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue
	
	Block a user