diff --git a/spacy/en/__init__.py b/spacy/en/__init__.py index dec591d55..1aae1e3a7 100644 --- a/spacy/en/__init__.py +++ b/spacy/en/__init__.py @@ -184,7 +184,8 @@ class English(object): self.entity(tokens) ent_strings = [None] * (max(self.entity.moves.label_ids.values()) + 1) for label, i in self.entity.moves.label_ids.items(): - ent_strings[i] = label + if i >= 0: + ent_strings[i] = label tokens._ent_strings = tuple(ent_strings) return tokens