Skip to content
Discussion options

You must be logged in to vote

Hi @Alvaro8gb , you have the following options here:

  • Get all the entities with doc.ents, remove what you don't need, and set it back again.
entities = doc.ents
new_entities = delete_entities(entities)  # implement this
doc.ents = new_entities
  • The doc.set_ents function also has parameters for setting entities as O (as in outside in IOB) like doc.set_ents(outside=[ent]) or you can set some as missing, like doc.set_ents(missing=[ent]).

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Alvaro8gb
Comment options

Answer selected by ljvmiranda921
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
usage General spaCy usage
2 participants