Expose parser's tok2vec model component

This commit is contained in:
Matthew Honnibal 2017-11-03 20:20:59 +01:00
parent 17c63906f9
commit 13c8881d2f

View File

@ -753,6 +753,14 @@ cdef class Parser:
for doc in docs:
hook(doc)
@property
def tok2vec(self):
'''Return the embedding and convolutional layer of the model.'''
if self.model in (None, True, False):
return None
else:
return self.model[0]
@property
def postprocesses(self):
# Available for subclasses, e.g. to deprojectivize