Fix mistake loading GloVe vectors. GloVe vectors now loaded by default if present, as promised.

This commit is contained in:
Matthew Honnibal 2016-10-20 16:57:53 +02:00
parent bfe5cb1244
commit ddeabd76c4

View File

@ -25,7 +25,9 @@ def load(name, **overrides):
path = util.match_best_version(target_name, target_version, path)
if isinstance(overrides.get('vectors'), basestring):
vectors = util.match_best_version(overrides.get('vectors'), None, path)
vectors_path = util.match_best_version(overrides.get('vectors'), None, path)
overrides['vectors'] = lambda nlp: nlp.vocab.load_vectors_from_bin_loc(
vectors_path / 'vocab' / 'vec.bin')
cls = get_lang_class(target_name)
return cls(path=path, **overrides)