From b7b18c279d2a594983319f16f92507643abdd34a Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Wed, 10 Jun 2015 11:33:39 +0200 Subject: [PATCH] * Fix Reduce oracle. Getting 86.35 --- spacy/syntax/arc_eager.pyx | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/spacy/syntax/arc_eager.pyx b/spacy/syntax/arc_eager.pyx index 99fe7f943..222388b69 100644 --- a/spacy/syntax/arc_eager.pyx +++ b/spacy/syntax/arc_eager.pyx @@ -149,10 +149,7 @@ cdef class Reduce: @staticmethod cdef inline int move_cost(StateClass st, const GoldParseC* gold) nogil: - if st.shifted[st.S(0)]: - return pop_cost(st, gold, st.S(0)) - else: - return 0 + return pop_cost(st, gold, st.S(0)) @staticmethod cdef inline int label_cost(StateClass s, const GoldParseC* gold, int label) nogil: @@ -233,8 +230,9 @@ cdef class Break: @staticmethod cdef int transition(StateClass st, int label) nogil: - #st.set_sent_end() - pass + #st.set_sent_start() + while st.stack_depth() >= 2 and st.buffer_length() == 0: + Reduce.transition(st, -1) @staticmethod cdef int cost(StateClass s, const GoldParseC* gold, int label) nogil: