mirror of https://github.com/explosion/spaCy.git
* Check serializer freqs exist before loading
This commit is contained in:
parent
17eacf8f70
commit
a412c66c8c
|
@ -47,7 +47,10 @@ cdef class Vocab:
|
||||||
|
|
||||||
tag_map = json.load(open(path.join(data_dir, 'tag_map.json')))
|
tag_map = json.load(open(path.join(data_dir, 'tag_map.json')))
|
||||||
lemmatizer = Lemmatizer.from_dir(path.join(data_dir, '..'))
|
lemmatizer = Lemmatizer.from_dir(path.join(data_dir, '..'))
|
||||||
|
if path.exists(path.join(data_dir, 'serializer.json')):
|
||||||
serializer_freqs = json.load(open(path.join(data_dir, 'serializer.json')))
|
serializer_freqs = json.load(open(path.join(data_dir, 'serializer.json')))
|
||||||
|
else:
|
||||||
|
serialize_feqs=None
|
||||||
cdef Vocab self = cls(get_lex_attr=get_lex_attr, vectors=vectors, tag_map=tag_map,
|
cdef Vocab self = cls(get_lex_attr=get_lex_attr, vectors=vectors, tag_map=tag_map,
|
||||||
lemmatizer=lemmatizer, serializer_freqs=serializer_freqs)
|
lemmatizer=lemmatizer, serializer_freqs=serializer_freqs)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue