From fa82277398fbc0e8ddb46a6af4f33e18e3102448 Mon Sep 17 00:00:00 2001 From: Matthw Honnibal Date: Mon, 7 Oct 2019 16:50:15 +0200 Subject: [PATCH] Fix get labels for textcat --- spacy/pipeline/pipes.pyx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/spacy/pipeline/pipes.pyx b/spacy/pipeline/pipes.pyx index 23509fcae..a02e8d981 100644 --- a/spacy/pipeline/pipes.pyx +++ b/spacy/pipeline/pipes.pyx @@ -1033,8 +1033,7 @@ class TextCategorizer(Pipe): return 1 def begin_training(self, get_gold_tuples=lambda: [], pipeline=None, sgd=None, **kwargs): - for raw_text, annots_brackets in get_gold_tuples(): - cats = annots_brackets.pop() + for raw_text, (_, (cats, _2)) in get_gold_tuples(): for cat in cats: self.add_label(cat) if self.model is True: