ValueError('[E1010] Unable to set entity information for token 3 which is included in more than one span in entities, blocked, missing or outside.') #12373
-
How to reproduce the behaviourFirst here is the code:
And here is my json:
When i run the above code there is an error: ValueError('[E1010] Unable to set entity information for token 3 which is included in more than one span in entities, blocked, missing or outside.') But i checked there are only three spans in the entities array which are "Fever", "Stomach hurt" and "Head pain". Noway Head pain overlapped with Stomach hurt right guys?. I just can't figure why? My Environment
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hey, The problem is the Here's a suggestion on how to fix your problem, you initialize the
Hope this helps! |
Beta Was this translation helpful? Give feedback.
Hey,
Thanks for the report, however, this isn't a spaCy issue.
The problem is the
_ents
list, every iteration, you're adding more entities to the list from differentdoc
objects and trying to set them as.ents
per individualdoc
. That's why you're getting theValueError
.Here's a suggestion on how to fix your problem, you initialize the
_ents
list inside the loop, so that it doesn't collect all the entities from differentdoc
objects.