mirror of https://github.com/explosion/spaCy.git
Merge pull request #1916 from tokestermw/bug/fix-not-passing-in-model-cfg-in-nlp
Bug/fix not passing in model cfg in nlp
This commit is contained in:
commit
2e7391e627
|
@ -461,7 +461,8 @@ class Language(object):
|
||||||
if hasattr(proc, 'begin_training'):
|
if hasattr(proc, 'begin_training'):
|
||||||
proc.begin_training(get_gold_tuples(),
|
proc.begin_training(get_gold_tuples(),
|
||||||
pipeline=self.pipeline,
|
pipeline=self.pipeline,
|
||||||
sgd=self._optimizer)
|
sgd=self._optimizer,
|
||||||
|
**cfg)
|
||||||
return self._optimizer
|
return self._optimizer
|
||||||
|
|
||||||
def evaluate(self, docs_golds, verbose=False):
|
def evaluate(self, docs_golds, verbose=False):
|
||||||
|
|
|
@ -0,0 +1,19 @@
|
||||||
|
# coding: utf8
|
||||||
|
|
||||||
|
from __future__ import unicode_literals
|
||||||
|
from ...language import Language
|
||||||
|
|
||||||
|
|
||||||
|
def test_simple_ner():
|
||||||
|
cfg = {
|
||||||
|
'hidden_depth': 2, # should error out
|
||||||
|
}
|
||||||
|
|
||||||
|
nlp = Language()
|
||||||
|
nlp.add_pipe(nlp.create_pipe('ner'))
|
||||||
|
nlp.get_pipe('ner').add_label('answer')
|
||||||
|
try:
|
||||||
|
nlp.begin_training(**cfg)
|
||||||
|
assert False # should error out
|
||||||
|
except ValueError:
|
||||||
|
assert True
|
Loading…
Reference in New Issue