mirror of
https://github.com/explosion/spaCy.git
synced 2024-11-11 04:08:09 +03:00
Fix NeuralLabeller
This commit is contained in:
parent
0acce0521b
commit
3cb8f06881
|
@ -296,7 +296,6 @@ class NeuralTagger(BaseThincComponent):
|
||||||
|
|
||||||
if self.model.nI is None:
|
if self.model.nI is None:
|
||||||
self.model.nI = tokvecs[0].shape[1]
|
self.model.nI = tokvecs[0].shape[1]
|
||||||
|
|
||||||
tag_scores, bp_tag_scores = self.model.begin_update(docs_tokvecs, drop=drop)
|
tag_scores, bp_tag_scores = self.model.begin_update(docs_tokvecs, drop=drop)
|
||||||
loss, d_tag_scores = self.get_loss(docs, golds, tag_scores)
|
loss, d_tag_scores = self.get_loss(docs, golds, tag_scores)
|
||||||
|
|
||||||
|
@ -432,7 +431,7 @@ class NeuralLabeller(NeuralTagger):
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def labels(self):
|
def labels(self):
|
||||||
return self.cfg.get('labels', {})
|
return self.cfg.setdefault('labels', {})
|
||||||
|
|
||||||
@labels.setter
|
@labels.setter
|
||||||
def labels(self, value):
|
def labels(self, value):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user