In the en_core_web_trf model, using the entity_linker, the training loss does not decrease #12825
Replies: 1 comment 2 replies
-
Hi @wh5938316!
My first guess here: the transformer wasn't trained with the objective of producing embeddings that reflect document similarity via cosine distance. If you want to use transformers for this, I'd recommend using
Four years are a long time in this field, so it's difficult to summarize the developments here. In a nutshell - entity linking has moved towards leveraging embeddings even more since 2019, and there are more end-to-end approaches (i. e. without selecting a shortlist of viable candidates as a prior step, and instead directly choosing the entity to link from the entire set of available entities). An example for how this may look like with a generic set of underlying embeddings is DEER, which we are potentially integrating in spaCy v4 (which will feature other improvements w.r.t. entity linking too, such as support for customizable and external knowledge bases). |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I have completed the training of the first EntityLinker model following the instructions in
tutorials/nel_emerson
.I noticed that the
tutorials/nel_emerson
uses theen_core_web_lg
model, whereas theen_core_web_trf
model usestransformers
instead oftok2vec
. Therefore, after I replaced the model withen_core_web_trf
, I found thatdoc.vector
is an empty array, which is as expected. So, I got the vector usingdoc._.trf_data.model_output.last_hidden_state[0, 0, :]
. The subsequent steps have not changed from the process intutorials/nel_emerson
.However, during the training of the entity linking model, the training loss did not decrease as quickly as before.
I know there must be something wrong with this approach, but I don't know the specific reason. I am a newbie in NLP and just getting into this field.
If I want to use
transformers
and the entity description of KnowledgeBase to convert vectors, can I use tok2vec?Four years after the
tutorials/nel_emerson
was proposed in 2019, have there been any new developments in the field of entity linking?Can anyone answer these questions for me, thank you very much!
Beta Was this translation helpful? Give feedback.
All reactions