Plz take a look at my code:
import spacy
nlp = spacy.load('en_core_web_sm')
a=nlp('fjoeij foeijfo foejf')
a[0].vector
array([ 4.4017673 , 2.2732968 , 1.8201342 , 0.285315 , 4.301816 ,
-1.6101733 , -1.9763635 , 0.7946968 , -0.49857655, 2.4312825 ,
-0.5321884 , 1.8810408 , -2.4434211 , -0.1565853 , -0.3007983 ,
-0.5251692 , -0.47107434, 2.392819 , -2.1653428 ......
You can see that they are not words, I just randomly typed in. But spacy can still generate the vectors. So, I have two questions:
- How spacy generate vectors?
- All the vectors are 96 dimensions. Can I change the number of dimensions?