Add move_names property to parser

This commit is contained in:
Matthew Honnibal 2017-05-27 15:51:55 -05:00
parent 8de9829f09
commit 3eea5383a1
1 changed files with 8 additions and 0 deletions

View File

@ -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,