From f0c696b4aa3e2fd6b6af4bf0b2f6c6e1ddaf465a Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Sat, 16 Jan 2021 13:44:11 +1100 Subject: [PATCH] Fix failed merge of #6694 patch --- spacy/pipeline/_parser_internals/arc_eager.pyx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/spacy/pipeline/_parser_internals/arc_eager.pyx b/spacy/pipeline/_parser_internals/arc_eager.pyx index 7c4bb0184..0f89132ea 100644 --- a/spacy/pipeline/_parser_internals/arc_eager.pyx +++ b/spacy/pipeline/_parser_internals/arc_eager.pyx @@ -197,7 +197,7 @@ cdef class ArcEagerGold: self.mem = Pool() heads, labels = example.get_aligned_parse(projectivize=True) labels = [example.x.vocab.strings.add(label) if label is not None else MISSING_DEP for label in labels] - sent_starts = example.get_aligned_sent_starts() + sent_starts = _get_aligned_sent_starts(example) assert len(heads) == len(labels) == len(sent_starts), (len(heads), len(labels), len(sent_starts)) self.c = create_gold_state(self.mem, stcls.c, heads, labels, sent_starts) @@ -812,6 +812,7 @@ cdef class ArcEager(TransitionSystem): raise ValueError("Could not find gold transition - see logs above.") def get_oracle_sequence_from_state(self, StateClass state, ArcEagerGold gold, _debug=None): + assert _debug is not None cdef int i cdef Pool mem = Pool() # n_moves should not be zero at this point, but make sure to avoid zero-length mem alloc @@ -846,7 +847,7 @@ cdef class ArcEager(TransitionSystem): else: failed = False break - if failed: + if failed and _debug not in (False, None): example = _debug print("Actions") for i in range(self.n_moves):