mirror of
				https://github.com/explosion/spaCy.git
				synced 2025-11-04 01:48:04 +03:00 
			
		
		
		
	Update GloVe vectors example
This commit is contained in:
		
							parent
							
								
									bfe17b7df1
								
							
						
					
					
						commit
						0fbab8160d
					
				| 
						 | 
					@ -161,10 +161,16 @@ p
 | 
				
			||||||
        +cell float64 (double)
 | 
					        +cell float64 (double)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
+code.
 | 
					+code.
 | 
				
			||||||
    from spacy.vectors import Vectors
 | 
					    nlp = spacy.load('en')
 | 
				
			||||||
 | 
					    nlp.vocab.vectors.from_glove('/path/to/vectors')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    vectors = Vectors([], 128)
 | 
					p
 | 
				
			||||||
    vectors.from_glove('/path/to/vectors')
 | 
					    |  If your instance of #[code Language] already contains vectors, they will
 | 
				
			||||||
 | 
					    |  be overwritten. To create your own GloVe vectors model package like
 | 
				
			||||||
 | 
					    |  spaCy's #[+a("/models/en#en_vectors_web_lg") #[code en_vectors_web_lg]],
 | 
				
			||||||
 | 
					    |  you can call #[+api("language#to_disk") #[code nlp.to_disk]], and then
 | 
				
			||||||
 | 
					    |  package the model using the #[+api("cli#package") #[code package]]
 | 
				
			||||||
 | 
					    |  command.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
+h(3, "custom-loading-other") Loading other vectors
 | 
					+h(3, "custom-loading-other") Loading other vectors
 | 
				
			||||||
    +tag-new(2)
 | 
					    +tag-new(2)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue
	
	Block a user