diff --git a/spacy/vocab.pyx b/spacy/vocab.pyx index 1b1b04e13..3617e70bb 100644 --- a/spacy/vocab.pyx +++ b/spacy/vocab.pyx @@ -316,6 +316,9 @@ cdef class Vocab: DOCS: https://spacy.io/api/vocab#prune_vectors """ xp = get_array_module(self.vectors.data) + # Make sure all vectors are in the vocab + for orth in self.vectors: + self[orth] # Make prob negative so it sorts by rank ascending # (key2row contains the rank) priority = [(-lex.prob, self.vectors.key2row[lex.orth], lex.orth)