From 555d8c8bffc8a3b31c0f3396b02fcf45cba4bd96 Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Thu, 5 Oct 2017 22:21:50 -0500 Subject: [PATCH] Fix beam history features --- spacy/syntax/nn_parser.pyx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/spacy/syntax/nn_parser.pyx b/spacy/syntax/nn_parser.pyx index e2c2b41c7..2b244bb70 100644 --- a/spacy/syntax/nn_parser.pyx +++ b/spacy/syntax/nn_parser.pyx @@ -508,9 +508,9 @@ cdef class Parser: if self.cfg.get('hist_size', 0): hists = numpy.asarray([st.history[:self.cfg['hist_size']] for st in states], dtype='i') - scores = vec2scores(vectors, drop=drop) + scores = vec2scores((vectors, hists)) else: - scores = vec2scores(vectors, drop=drop) + scores = vec2scores(vectors) j = 0 c_scores = scores.data for i in range(beam.size): @@ -723,7 +723,7 @@ cdef class Parser: lower, stream, drop=0.0) return (tokvecs, bp_tokvecs), state2vec, upper - nr_feature = 8 + nr_feature = 2 def get_token_ids(self, states): cdef StateClass state