From 6d42e0ad8efb1b52bc6e9d23dfbed61f030f8059 Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Tue, 3 Apr 2018 01:55:06 +0200 Subject: [PATCH] Fix handling of tuple-valued tags in Tagger --- spacy/pipeline.pyx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/spacy/pipeline.pyx b/spacy/pipeline.pyx index b1e4313a8..d5bbb3550 100644 --- a/spacy/pipeline.pyx +++ b/spacy/pipeline.pyx @@ -503,6 +503,8 @@ class Tagger(Pipe): elif isinstance(tag, list): # Leave these latent for now. correct[idx] = guesses[idx] else: + if isinstance(tag, tuple): + tag = tag[0] correct[idx] = tag_index[tag] idx += 1 correct = self.model.ops.xp.array(correct, dtype='i')