mirror of
				https://github.com/explosion/spaCy.git
				synced 2025-11-04 09:57:26 +03:00 
			
		
		
		
	Avoid clobbering preset POS tags
This commit is contained in:
		
							parent
							
								
									939e8ed567
								
							
						
					
					
						commit
						3680c51b8f
					
				| 
						 | 
					@ -233,6 +233,8 @@ class NeuralTagger(object):
 | 
				
			||||||
        for i, doc in enumerate(docs):
 | 
					        for i, doc in enumerate(docs):
 | 
				
			||||||
            doc_tag_ids = batch_tag_ids[i]
 | 
					            doc_tag_ids = batch_tag_ids[i]
 | 
				
			||||||
            for j, tag_id in enumerate(doc_tag_ids):
 | 
					            for j, tag_id in enumerate(doc_tag_ids):
 | 
				
			||||||
 | 
					                # Don't clobber preset POS tags
 | 
				
			||||||
 | 
					                if doc.c[j].tag == 0 and doc.c[j].pos == 0:
 | 
				
			||||||
                    vocab.morphology.assign_tag_id(&doc.c[j], tag_id)
 | 
					                    vocab.morphology.assign_tag_id(&doc.c[j], tag_id)
 | 
				
			||||||
                idx += 1
 | 
					                idx += 1
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue
	
	Block a user