Skip to content

Relation Extraction rel_model backprop problem with duplicate entities #12779

Discussion options

You must be logged in to vote

Hi, thanks for your question!

Won't that be problematic if the same entity appears more than once in the input doc??

By "the same entity", do you mean the same string, being tagged as an entity, as in "In Paris, I fell in love with Paris"?
Because in spaCy's terminology (and in the code), an "entity" is character-bound. That means that the first "Paris" will be a different entity as the second, and their ent.start and ent.end properties will be different.

If you look at the backprop implementation in rel_model.py, you'll see that the backpropped information from the pooling layer (d_ents) is propagated to each individual, character-bound entity:

d_tokvec[ent.start : ent.end] += d_ents[e…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@jefhil
Comment options

@svlandeg
Comment options

@jefhil
Comment options

Answer selected by svlandeg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat / rel Feature: Relation Extractor
2 participants