mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-26 18:06:29 +03:00
Fix get labels for textcat
This commit is contained in:
parent
cbc2cee2c8
commit
fa82277398
|
@ -1033,8 +1033,7 @@ class TextCategorizer(Pipe):
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
def begin_training(self, get_gold_tuples=lambda: [], pipeline=None, sgd=None, **kwargs):
|
def begin_training(self, get_gold_tuples=lambda: [], pipeline=None, sgd=None, **kwargs):
|
||||||
for raw_text, annots_brackets in get_gold_tuples():
|
for raw_text, (_, (cats, _2)) in get_gold_tuples():
|
||||||
cats = annots_brackets.pop()
|
|
||||||
for cat in cats:
|
for cat in cats:
|
||||||
self.add_label(cat)
|
self.add_label(cat)
|
||||||
if self.model is True:
|
if self.model is True:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user