dalab / deep-ed

Source code for the EMNLP'17 paper "Deep Joint Entity Disambiguation with Local Neural Attention", https://arxiv.org/abs/1704.04920
Apache License 2.0
223 stars 50 forks source link

Entity Prediction #7

Closed zisding closed 6 years ago

zisding commented 6 years ago

Hi, thanks for the code. It is really a good work.

I have one question with the following code: In the code test.lua,

local _, argmax_idx = torch.max(pred, 1)
local winning_entiid = ent_wikiids[argmax_idx[1]]

it seems that it uses torch.max to select the entity with the max value as the predicted entity, what if there are several candidate entities with the same maximum prediction score? (I am not familiar with lua, please correct me, if there are any problems.)

I don't know whether this problem exists in the experiments. If it does, it would influence the results of these experiments.

Thank you.

octavian-ganea commented 6 years ago

If more than one candidate entity has the same score, then torch.max will select the first one. This could be a problem, but given that the predictions are real numbers produced by the neural network, it is very unlikely that two of them will have the exact same value. TL;DR, theoretically this might be an issue, but practically I think it is very unlikely.

zisding commented 6 years ago

Thank you. The answer is reasonable. It's very unlikely that two or more entities have the same score if they have a different context.