mirror of
https://github.com/explosion/spaCy.git
synced 2025-01-27 01:34:30 +03:00
Fix type check for long
This commit is contained in:
parent
92dbf28c1e
commit
6d3caeadd2
|
@ -684,10 +684,10 @@ cdef class Doc:
|
|||
attributes[ENT_TYPE] = ent_type
|
||||
elif not args:
|
||||
if "label" in attributes and 'ent_type' not in attributes:
|
||||
if type(attributes["label"]) == int:
|
||||
if isinstance(attributes["label"], int):
|
||||
attributes[ENT_TYPE] = attributes["label"]
|
||||
else:
|
||||
attributes[ENT_TYPE] = self.vocab.strings.add(attributes["label"])
|
||||
attributes[ENT_TYPE] = self.vocab.strings[attributes["label"])
|
||||
if 'ent_type' in attributes:
|
||||
attributes[ENT_TYPE] = attributes['ent_type']
|
||||
elif args:
|
||||
|
|
Loading…
Reference in New Issue
Block a user