From 231ce2dae5b110087085f3d9353bac4ed287215f Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Fri, 20 Mar 2015 01:16:12 +0100 Subject: [PATCH] * Assign ROOT label by default. May be papering over another bug. --- spacy/tokens.pyx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/spacy/tokens.pyx b/spacy/tokens.pyx index e6f5d3068..5d727c01e 100644 --- a/spacy/tokens.pyx +++ b/spacy/tokens.pyx @@ -249,6 +249,8 @@ cdef class Tokens: self.is_parsed = True for i in range(self.length): self.data[i] = parsed[i] + if self.data[i].dep == 0: + self.data[i].dep = self.vocab.strings['ROOT'] cdef class Span: