diff --git a/spacy/lemmatizer.py b/spacy/lemmatizer.py index 7f0a6fb7a..9c8f0e716 100644 --- a/spacy/lemmatizer.py +++ b/spacy/lemmatizer.py @@ -28,7 +28,7 @@ class Lemmatizer(object): exc[pos] = read_exc(file_) else: exc[pos] = {} - with (path / 'vocab' / 'lemma_rules.json').open() as file_: + with (path / 'vocab' / 'lemma_rules.json').open('rb') as file_: rules = json.load(file_) return cls(index, exc, rules) diff --git a/spacy/matcher.pyx b/spacy/matcher.pyx index c3e40c1a0..fbfa18c1e 100644 --- a/spacy/matcher.pyx +++ b/spacy/matcher.pyx @@ -175,7 +175,7 @@ cdef class Matcher: @classmethod def load(cls, path, vocab): if (path / 'gazetteer.json').exists(): - with (path / 'gazetteer.json').open() as file_: + with (path / 'gazetteer.json').open('rb') as file_: patterns = json.load(file_) else: patterns = {}