mirror of
				https://github.com/explosion/spaCy.git
				synced 2025-10-31 07:57:35 +03:00 
			
		
		
		
	Update lexeme ranks for loaded vectors (#8640)
Update the ranks for any lexemes that have been added to the vocab before the vectors are added to the model.
This commit is contained in:
		
							parent
							
								
									e532c69475
								
							
						
					
					
						commit
						0e4b96c97e
					
				|  | @ -156,6 +156,8 @@ def load_vectors_into_model( | |||
|         logger.warning(Warnings.W112.format(name=name)) | ||||
| 
 | ||||
|     nlp.vocab.vectors = vectors_nlp.vocab.vectors | ||||
|     for lex in nlp.vocab: | ||||
|         lex.rank = nlp.vocab.vectors.key2row.get(lex.orth, OOV_RANK) | ||||
|     if add_strings: | ||||
|         # I guess we should add the strings from the vectors_nlp model? | ||||
|         # E.g. if someone does a similarity query, they might expect the strings. | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue
	
	Block a user