From f21ab2d7fbdef9647b02fb396443f4e85c68d638 Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Wed, 11 Mar 2015 02:26:40 -0400 Subject: [PATCH] * Fix bug in ugly ent_strings hack on English class --- spacy/en/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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