From 8f5b60c168f47c1be476627cc1b90f706f19038d Mon Sep 17 00:00:00 2001 From: Anto Binish Kaspar Date: Tue, 17 Oct 2017 17:15:32 +0530 Subject: [PATCH] Fix Language.from_disk overwrites the meta.json file. --- spacy/language.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spacy/language.py b/spacy/language.py index 7fd56ed56..332a814b4 100644 --- a/spacy/language.py +++ b/spacy/language.py @@ -585,7 +585,7 @@ class Language(object): deserializers = OrderedDict(( ('vocab', lambda p: self.vocab.from_disk(p)), ('tokenizer', lambda p: self.tokenizer.from_disk(p, vocab=False)), - ('meta.json', lambda p: p.open('w').write(json_dumps(self.meta))) + ('meta.json', lambda p: self.meta.update(ujson.load(p.open('r')))) )) for name, proc in self.pipeline: if name in disable: