mirror of
				https://github.com/explosion/spaCy.git
				synced 2025-11-04 09:57:26 +03:00 
			
		
		
		
	Fix #1929: Incorrect NER when pre-set sentence boundaries.
This commit is contained in:
		
							parent
							
								
									fd9fd275c5
								
							
						
					
					
						commit
						e361b4f82b
					
				| 
						 | 
					@ -281,7 +281,7 @@ cdef class Begin:
 | 
				
			||||||
        elif preset_ent_iob == 3 and st.B_(1).ent_iob != 1:
 | 
					        elif preset_ent_iob == 3 and st.B_(1).ent_iob != 1:
 | 
				
			||||||
            return False
 | 
					            return False
 | 
				
			||||||
        # Don't allow entities to extend across sentence boundaries
 | 
					        # Don't allow entities to extend across sentence boundaries
 | 
				
			||||||
        elif st.B_(1).sent_start:
 | 
					        elif st.B_(1).sent_start == 1:
 | 
				
			||||||
            return False
 | 
					            return False
 | 
				
			||||||
        else:
 | 
					        else:
 | 
				
			||||||
            return label != 0 and not st.entity_is_open()
 | 
					            return label != 0 and not st.entity_is_open()
 | 
				
			||||||
| 
						 | 
					@ -327,7 +327,7 @@ cdef class In:
 | 
				
			||||||
        elif st.B_(1).ent_iob != preset_ent_iob:
 | 
					        elif st.B_(1).ent_iob != preset_ent_iob:
 | 
				
			||||||
            return False
 | 
					            return False
 | 
				
			||||||
        # Don't allow entities to extend across sentence boundaries
 | 
					        # Don't allow entities to extend across sentence boundaries
 | 
				
			||||||
        elif st.B_(1).sent_start:
 | 
					        elif st.B_(1).sent_start == 1:
 | 
				
			||||||
            return False
 | 
					            return False
 | 
				
			||||||
        return st.entity_is_open() and label != 0 and st.E_(0).ent_type == label
 | 
					        return st.entity_is_open() and label != 0 and st.E_(0).ent_type == label
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue
	
	Block a user