From c390f2d74506e2588a7ef7b265b03057d1453d62 Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Tue, 31 Oct 2017 20:14:47 +0100 Subject: [PATCH] Make it easier to pass explicit no-pruning to vocab --- spacy/cli/vocab.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spacy/cli/vocab.py b/spacy/cli/vocab.py index 9847dd3d889..5f6f58d8046 100644 --- a/spacy/cli/vocab.py +++ b/spacy/cli/vocab.py @@ -22,7 +22,7 @@ "option", "V", int) ) def make_vocab(cmd, lang, output_dir, lexemes_loc, - vectors_loc=None, prune_vectors=0): + vectors_loc=None, prune_vectors=-1): """Compile a vocabulary from a lexicon jsonl file and word vectors.""" if not lexemes_loc.exists(): prints(lexemes_loc, title="Can't find lexical data", exits=1) @@ -49,7 +49,7 @@ def make_vocab(cmd, lang, output_dir, lexemes_loc, if word.rank: nlp.vocab.vectors.add(word.orth, row=word.rank) - if prune_vectors is not None: + if prune_vectors >= 1: remap = nlp.vocab.prune_vectors(prune_vectors) if not output_dir.exists(): output_dir.mkdir()