How to delete ents in a doc #11853
Answered
by
ljvmiranda921
Alvaro8gb
asked this question in
Help: Coding & Implementations
-
I am trying to delete an entity but its giving me errors, with this code |
Beta Was this translation helpful? Give feedback.
Answered by
ljvmiranda921
Nov 24, 2022
Replies: 1 comment 1 reply
-
Hi @Alvaro8gb , you have the following options here:
entities = doc.ents
new_entities = delete_entities(entities) # implement this
doc.ents = new_entities
|
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
ljvmiranda921
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi @Alvaro8gb , you have the following options here:
doc.ents
, remove what you don't need, and set it back again.doc.set_ents
function also has parameters for setting entities asO
(as in outside in IOB) likedoc.set_ents(outside=[ent])
or you can set some as missing, likedoc.set_ents(missing=[ent])
.