From 3eea5383a1adc179ed7d7feb2c957b1d78f0171b Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Sat, 27 May 2017 15:51:55 -0500 Subject: [PATCH] Add move_names property to parser --- spacy/syntax/nn_parser.pyx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/spacy/syntax/nn_parser.pyx b/spacy/syntax/nn_parser.pyx index 35966d536..6db6e5ae1 100644 --- a/spacy/syntax/nn_parser.pyx +++ b/spacy/syntax/nn_parser.pyx @@ -518,6 +518,14 @@ cdef class Parser: xp.add.at(d_tokvecs, ids, d_state_features * active_feats) + @property + def move_names(self): + names = [] + for i in range(self.moves.n_moves): + name = self.moves.move_name(self.moves.c[i].move, self.moves.c[i].label) + names.append(name) + return names + def get_batch_model(self, batch_size, tokvecs, stream, dropout): lower, upper = self.model state2vec = precompute_hiddens(batch_size, tokvecs,