Relation Extraction rel_model backprop problem with duplicate entities #12779
-
The backprop function in the Relation Extraction example seems to use the pooled vectors as an index back to the entities. (P.S. Thanks again for all your excellent software and advice!) |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Hi, thanks for your question!
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"? If you look at the
So we don't go by the string - we go by the offsets in the text to avoid issues. Does that answer your question? |
Beta Was this translation helpful? Give feedback.
Hi, thanks for your question!
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
andent.end
properties will be different.If you look at the
backprop
implementation inrel_model.py
, you'll see that the backpropped information from the pooling layer (d_ents
) is propagated to each individual, character-bound entity: