From a412c66c8ce08effd57abf75c0a31826c97dcb50 Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Sat, 12 Sep 2015 23:40:01 +0200 Subject: [PATCH] * Check serializer freqs exist before loading --- spacy/vocab.pyx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/spacy/vocab.pyx b/spacy/vocab.pyx index 6f711260b..a3d6b999b 100644 --- a/spacy/vocab.pyx +++ b/spacy/vocab.pyx @@ -47,7 +47,10 @@ cdef class Vocab: tag_map = json.load(open(path.join(data_dir, 'tag_map.json'))) lemmatizer = Lemmatizer.from_dir(path.join(data_dir, '..')) - serializer_freqs = json.load(open(path.join(data_dir, 'serializer.json'))) + if path.exists(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, lemmatizer=lemmatizer, serializer_freqs=serializer_freqs)