Fix GoldParse

This commit is contained in:
Matthew Honnibal 2016-10-15 23:55:07 +02:00
parent 1c62573a41
commit 0317cea0ad

View File

@ -221,8 +221,8 @@ cdef class GoldParse:
return cls(doc, words=words, tags=tags, heads=heads, deps=deps, entities=entities, return cls(doc, words=words, tags=tags, heads=heads, deps=deps, entities=entities,
make_projective=make_projective) make_projective=make_projective)
def __init__(cls, doc, annot_tuples=None, words=None, tags=None, heads=None, def __init__(self, doc, annot_tuples=None, words=None, tags=None, heads=None,
deps=None, entities=None): deps=None, entities=None, make_projective=False):
if words is None: if words is None:
words = [token.text for token in doc] words = [token.text for token in doc]
if tags is None: if tags is None:
@ -241,7 +241,7 @@ cdef class GoldParse:
self.mem = Pool() self.mem = Pool()
self.loss = 0 self.loss = 0
self.length = len(tokens) self.length = len(doc)
# These are filled by the tagger/parser/entity recogniser # These are filled by the tagger/parser/entity recogniser
self.c.tags = <int*>self.mem.alloc(len(doc), sizeof(int)) self.c.tags = <int*>self.mem.alloc(len(doc), sizeof(int))