Number of dimensions for each word vector in a given model 'en' is 0

Viewed 268

I want to print the number of dimensions for each word vector from the spacy language model 'en'. I installed both the language model and spacy. I have following lines of code

import spacy
nlp =spacy.load('en')
dim = nlp.vocab.vectors_length
print(dim)

It gives 0.

Can someone help me with this?

1 Answers

The default en model doesn't include word vectors. You should use the en_core_web_md or en_core_web_lg models instead, which do.

Related