From 4ef68c413fbbc74958c8cd0cc3d8baa99e4cdfa2 Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Wed, 15 Mar 2017 16:40:27 -0500 Subject: [PATCH] Approximate cost in Break transition, to speed things up a bit. --- spacy/syntax/arc_eager.pyx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/spacy/syntax/arc_eager.pyx b/spacy/syntax/arc_eager.pyx index 7049b8595..bea0c9b45 100644 --- a/spacy/syntax/arc_eager.pyx +++ b/spacy/syntax/arc_eager.pyx @@ -272,6 +272,8 @@ cdef class Break: B_i = s.B(j) cost += gold.heads[S_i] == B_i cost += gold.heads[B_i] == S_i + if cost != 0: + return cost # Check for sentence boundary --- if it's here, we can't have any deps # between stack and buffer, so rest of action is irrelevant. s0_root = _get_root(s.S(0), gold)