Closed hertelm closed 2 years ago
Hi,
I used mention_trie.add(model.encode(" {}".format(e))[1:].tolist())
to create the trie. But then I also appended a white space to every input sentence so that the model will always allow the begining of a sentence/ paragraph to be a mention.
I follow the example for end-to-end entity linking with constraints on mentions and candidates.
For the text "In 1921, Einstein received a Nobel Prize." I get the expected output:
When the text is "Einstein received a Nobel Prize in 1921." or "Nobel Prize was given to Einstein in 1921.", the prediction takes very long, multiple minutes on GPU.
The results are:
I observe that the mentions in the beginning of the text are not recognized.
This can be solved by generating the mentions trie as follows, including the mention without preceding space:
Now the mentions in the beginning get recognized (see beams 3 and 4 in the first output and 2 and 3 in the second output - the spaces around the opening curly bracket look wrong though):
However, in both examples the model favors a beam where the mention in the beginning is not linked.
Would you recommend to include mentions without preceding space, or will the model never link them in the beginning of a text anyway? It could be that a bias in the training data prevents linking mentions in the beginning: the beginning of a Wikipedia abstract is usually the name of the article's entity, which is never a hyperlink to another article.
How did you deal with this in the experiments for the paper?
Thanks for letting me know + best regards, Matthias