From 88de8fe3232dca07e82ed7ca0a1a4a7a25a2cc81 Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Tue, 3 Apr 2018 01:54:21 +0200 Subject: [PATCH] Fix pre-processing of more complicated heads in ArcEager --- spacy/syntax/arc_eager.pyx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spacy/syntax/arc_eager.pyx b/spacy/syntax/arc_eager.pyx index f61b15e7a..37278a6f3 100644 --- a/spacy/syntax/arc_eager.pyx +++ b/spacy/syntax/arc_eager.pyx @@ -508,14 +508,14 @@ cdef class ArcEager(TransitionSystem): gold.c.labels[index] = 0 gold.c.has_dep[index] = False for child_i, (head_group, dep_group) in enumerate(zip(gold.heads, gold.labels)): - if not USE_SPLIT and isinstance(head_group, list): + if not USE_SPLIT and (isinstance(head_group, list) or isinstance(head_group, tuple)): # Set as missing values if we don't handle token splitting head_group = [(None, 0)] dep_group = [None] if not isinstance(head_group, list): # Map the simple format into the elaborate one we need for # the fused tokens. - head_group = [(head_group, 0)] + head_group = [head_group] dep_group = [dep_group] for child_j, (head_addr, dep) in enumerate(zip(head_group, dep_group)): if not isinstance(head_addr, tuple):