From 019d09e3c3d707bda9aa2abb1f5c504d3e08bd80 Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Tue, 3 Jul 2018 22:16:44 +0200 Subject: [PATCH] Fix init model --- spacy/cli/init_model.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/spacy/cli/init_model.py b/spacy/cli/init_model.py index effeef2a7..70c3a4334 100644 --- a/spacy/cli/init_model.py +++ b/spacy/cli/init_model.py @@ -69,12 +69,7 @@ def init_model(lang, output_dir, freqs_loc=None, clusters_loc=None, jsonl_loc=No vectors_loc = ensure_path(vectors_loc) if vectors_loc and vectors_loc.parts[-1].endswith('.npz'): vector_data = numpy.load(vectors_loc.open('rb')) - nlp.vocab.vectors = Vectors(data=vector_data) - vectors_keys = [] - for word in nlp.vocab: - if word.rank: - nlp.vocab.vectors.add(word.orth, row=word.rank) - vectors_keys.append(word.orth_) + vectors_keys = [lex['orth'] for lex in lex_attrs if 'id' in lex] else: vectors_data, vector_keys = read_vectors(vectors_loc) if vectors_loc else (None, None) nlp = create_model(lang, lex_attrs, vectors_data, vector_keys, prune_vectors)