mirror of
https://github.com/explosion/spaCy.git
synced 2025-01-26 09:14:32 +03:00
Fix labeller loss for unseen labels
This commit is contained in:
parent
c9760b2104
commit
a7ee63c0ac
|
@ -283,7 +283,7 @@ class NeuralLabeller(NeuralTagger):
|
||||||
guesses = scores.argmax(axis=1)
|
guesses = scores.argmax(axis=1)
|
||||||
for gold in golds:
|
for gold in golds:
|
||||||
for tag in gold.labels:
|
for tag in gold.labels:
|
||||||
if tag is None:
|
if tag is None or tag not in self.labels:
|
||||||
correct[idx] = guesses[idx]
|
correct[idx] = guesses[idx]
|
||||||
else:
|
else:
|
||||||
correct[idx] = self.labels[tag]
|
correct[idx] = self.labels[tag]
|
||||||
|
|
Loading…
Reference in New Issue
Block a user