mirror of
				https://github.com/explosion/spaCy.git
				synced 2025-11-04 01:48:04 +03:00 
			
		
		
		
	Use missing features in parser
This commit is contained in:
		
							parent
							
								
									df4803cc6d
								
							
						
					
					
						commit
						5414e2f14b
					
				| 
						 | 
					@ -157,10 +157,12 @@ cdef void sum_state_features(float* output,
 | 
				
			||||||
        const float* cached, const int* token_ids, int B, int F, int O) nogil:
 | 
					        const float* cached, const int* token_ids, int B, int F, int O) nogil:
 | 
				
			||||||
    cdef int idx, b, f, i
 | 
					    cdef int idx, b, f, i
 | 
				
			||||||
    cdef const float* feature
 | 
					    cdef const float* feature
 | 
				
			||||||
 | 
					    padding = cached - (F * O)
 | 
				
			||||||
    for b in range(B):
 | 
					    for b in range(B):
 | 
				
			||||||
        for f in range(F):
 | 
					        for f in range(F):
 | 
				
			||||||
            if token_ids[f] < 0:
 | 
					            if token_ids[f] < 0:
 | 
				
			||||||
                continue
 | 
					                feature = &padding[f*O]
 | 
				
			||||||
 | 
					            else:
 | 
				
			||||||
                idx = token_ids[f] * F * O + f*O
 | 
					                idx = token_ids[f] * F * O + f*O
 | 
				
			||||||
                feature = &cached[idx]
 | 
					                feature = &cached[idx]
 | 
				
			||||||
            for i in range(O):
 | 
					            for i in range(O):
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue
	
	Block a user