Skip to content

Commit

Permalink
Make it easier to pass explicit no-pruning to vocab
Browse files Browse the repository at this point in the history
  • Loading branch information
honnibal committed Oct 31, 2017
1 parent d90a22a commit c390f2d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions spacy/cli/vocab.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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()
Expand Down

0 comments on commit c390f2d

Please sign in to comment.