Skip to content

Commit

Permalink
Merge pull request #1 from rafiberlin/fix_spacy_parser
Browse files Browse the repository at this point in the history
fix the logic to init the SpacyParser
  • Loading branch information
rafiberlin committed Dec 3, 2021
2 parents 2a48ec3 + c428cc0 commit 0f6d3e3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sng_parser/backends/spacy_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ def __init__(self, model=None):
default_model = 'en_core_web_sm'

self.model = model
if self.model is not None:
if self.model is None:
self.model = default_model

try:
self.nlp = spacy.load(model)
self.nlp = spacy.load(self.model)
except OSError as e:
raise ImportError('Unable to load the English model. Run `python -m spacy download en` first.') from e

Expand Down

0 comments on commit 0f6d3e3

Please sign in to comment.