Skip to content

Commit

Permalink
Merge pull request #1650 from Tpt/patch-1
Browse files Browse the repository at this point in the history
Use Spacy 2 syntax to disable dependency parser
  • Loading branch information
wochinge committed Jan 29, 2019
2 parents 64d8276 + ca25341 commit 22af37f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Added

Changed
-------
- applied spacy guidelines on how to disable pipeline components

Removed
-------
Expand Down
4 changes: 2 additions & 2 deletions rasa_nlu/utils/spacy_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def create(cls, cfg: RasaNLUModelConfig) -> 'SpacyNLP':
logger.info("Trying to load spacy model with "
"name '{}'".format(spacy_model_name))

nlp = spacy.load(spacy_model_name, parser=False)
nlp = spacy.load(spacy_model_name, disable=['parser'])
cls.ensure_proper_language_model(nlp)
return SpacyNLP(component_conf, nlp)

Expand Down Expand Up @@ -109,7 +109,7 @@ def load(cls,
component_meta = model_metadata.for_component(cls.name)
model_name = component_meta.get("model")

nlp = spacy.load(model_name, parser=False)
nlp = spacy.load(model_name, disable=['parser'])
cls.ensure_proper_language_model(nlp)
return cls(component_meta, nlp)

Expand Down

0 comments on commit 22af37f

Please sign in to comment.