From 337d2b5ad65508ce0897d7fea49fa39e33a8d327 Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Tue, 9 Jun 2020 23:58:16 +0200 Subject: [PATCH] Fix sent start in NewExample --- spacy/gold/new_example.pyx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/spacy/gold/new_example.pyx b/spacy/gold/new_example.pyx index 136eca130..4247f21b5 100644 --- a/spacy/gold/new_example.pyx +++ b/spacy/gold/new_example.pyx @@ -94,13 +94,16 @@ def _annot2array(strings, tok_annot, doc_annot): elif key == "HEAD": attrs.append(key) values.append([h-i for i, h in enumerate(value)]) + elif key == "SENT_START": + attrs.append(key) + values.append(value) else: attrs.append(key) values.append([strings.add(v) for v in value]) # TODO: Calculate token.ent_kb_id from doc_annot["links"]. # We need to fix this and the doc.ents thing, both should be doc # annotations. - array = numpy.array(values, dtype="uint64") + array = numpy.asarray(values, dtype="uint64") return attrs, array.T