From e5757d4bf04054ec7b6fc56304e266948c7c255c Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Wed, 21 Feb 2018 16:00:00 +0100 Subject: [PATCH] Add labels property to parser --- spacy/syntax/nn_parser.pyx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/spacy/syntax/nn_parser.pyx b/spacy/syntax/nn_parser.pyx index b4b8d4779..6c7f5354d 100644 --- a/spacy/syntax/nn_parser.pyx +++ b/spacy/syntax/nn_parser.pyx @@ -790,6 +790,11 @@ cdef class Parser: for doc in docs: hook(doc) + @property + def labels(self): + class_names = [self.moves.get_class_name(i) for i in range(self.moves.n_moves)] + return class_names + @property def tok2vec(self): '''Return the embedding and convolutional layer of the model.'''