Add user_data attribute to Doc object.

This commit is contained in:
Matthew Honnibal 2016-10-17 11:43:22 +02:00
parent c1abc8f6ed
commit fbb7f3f15c
2 changed files with 3 additions and 0 deletions

View File

@ -33,6 +33,7 @@ cdef class Doc:
cdef public object _vector_norm cdef public object _vector_norm
cdef public np.ndarray tensor cdef public np.ndarray tensor
cdef public object user_data
cdef TokenC* c cdef TokenC* c

View File

@ -117,6 +117,8 @@ cdef class Doc:
self.is_parsed = False self.is_parsed = False
self.getters_for_tokens = {} self.getters_for_tokens = {}
self.getters_for_spans = {} self.getters_for_spans = {}
self.tensor = np.zeros((0,), dtype='float32')
self.user_data = {}
self._py_tokens = [] self._py_tokens = []
self._vector = None self._vector = None
self.noun_chunks_iterator = CHUNKERS.get(self.vocab.lang) self.noun_chunks_iterator = CHUNKERS.get(self.vocab.lang)