mirror of
				https://github.com/explosion/spaCy.git
				synced 2025-10-31 07:57:35 +03:00 
			
		
		
		
	Fix get_matching_ents (#10451)
* Fix get_matching_ents Not sure what happened here - the code prior to this commit simply does not work. It's already covered by entity linker tests, which were succeeding in the NEL PR, but couldn't possibly succeed on master. * Fix test Test was indented inside another test and so doesn't seem to have been running properly.
This commit is contained in:
		
							parent
							
								
									7ed7908716
								
							
						
					
					
						commit
						61ba5450ff
					
				|  | @ -263,11 +263,11 @@ cdef class Example: | |||
|         kept. Otherwise only the character indices need to match. | ||||
|         """ | ||||
|         gold = {} | ||||
|         for ent in self.reference: | ||||
|         for ent in self.reference.ents: | ||||
|             gold[(ent.start_char, ent.end_char)] = ent.label | ||||
| 
 | ||||
|         keep = [] | ||||
|         for ent in self.predicted: | ||||
|         for ent in self.predicted.ents: | ||||
|             key = (ent.start_char, ent.end_char) | ||||
|             if key not in gold: | ||||
|                 continue | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue
	
	Block a user