mirror of
https://github.com/explosion/spaCy.git
synced 2025-01-12 18:26:30 +03:00
* Fix bug in ugly ent_strings hack on English class
This commit is contained in:
parent
1c843934be
commit
f21ab2d7fb
|
@ -184,6 +184,7 @@ class English(object):
|
||||||
self.entity(tokens)
|
self.entity(tokens)
|
||||||
ent_strings = [None] * (max(self.entity.moves.label_ids.values()) + 1)
|
ent_strings = [None] * (max(self.entity.moves.label_ids.values()) + 1)
|
||||||
for label, i in self.entity.moves.label_ids.items():
|
for label, i in self.entity.moves.label_ids.items():
|
||||||
|
if i >= 0:
|
||||||
ent_strings[i] = label
|
ent_strings[i] = label
|
||||||
tokens._ent_strings = tuple(ent_strings)
|
tokens._ent_strings = tuple(ent_strings)
|
||||||
return tokens
|
return tokens
|
||||||
|
|
Loading…
Reference in New Issue
Block a user