Fix init_model.py

This commit is contained in:
Matthew Honnibal 2016-09-25 15:58:51 +02:00
parent e56653f848
commit ae202e7a60
1 changed files with 2 additions and 2 deletions

View File

@ -148,7 +148,7 @@ def _read_senses(loc):
return lexicon return lexicon
def setup_vocab(get_lex_attr, tag_map, src_dir, dst_dir): def setup_vocab(lex_attr_getters, tag_map, src_dir, dst_dir):
if not dst_dir.exists(): if not dst_dir.exists():
dst_dir.mkdir() dst_dir.mkdir()
@ -157,7 +157,7 @@ def setup_vocab(get_lex_attr, tag_map, src_dir, dst_dir):
write_binary_vectors(vectors_src.as_posix, (dst_dir / 'vec.bin').as_posix()) write_binary_vectors(vectors_src.as_posix, (dst_dir / 'vec.bin').as_posix())
else: else:
print("Warning: Word vectors file not found") print("Warning: Word vectors file not found")
vocab = Vocab(get_lex_attr=get_lex_attr, tag_map=tag_map) vocab = Vocab(lex_attr_getters=lex_attr_getters, tag_map=tag_map)
clusters = _read_clusters(src_dir / 'clusters.txt') clusters = _read_clusters(src_dir / 'clusters.txt')
probs, oov_prob = _read_probs(src_dir / 'words.sgt.prob') probs, oov_prob = _read_probs(src_dir / 'words.sgt.prob')
if not probs: if not probs: