diff --git a/spacy/_ml.py b/spacy/_ml.py index f79c5668a..898d6ab49 100644 --- a/spacy/_ml.py +++ b/spacy/_ml.py @@ -231,6 +231,8 @@ class Embed(Model): name = 'embed' def __init__(self, nO, nV=None, **kwargs): + if nV is not None: + nV += 1 Model.__init__(self, **kwargs) if 'name' in kwargs: self.name = kwargs['name'] diff --git a/spacy/syntax/_state.pxd b/spacy/syntax/_state.pxd index 50146401e..1864b22b3 100644 --- a/spacy/syntax/_state.pxd +++ b/spacy/syntax/_state.pxd @@ -297,7 +297,7 @@ cdef cppclass StateC: + hash64(&this._hist, sizeof(RingBufferC), 1) void push_hist(int act) nogil: - ring_push(&this._hist, act) + ring_push(&this._hist, act+1) int get_hist(int i) nogil: return ring_get(&this._hist, i)