Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inference time when calulating MRR #8

Closed
TamSiuhin opened this issue Apr 25, 2022 · 4 comments
Closed

Inference time when calulating MRR #8

TamSiuhin opened this issue Apr 25, 2022 · 4 comments

Comments

@TamSiuhin
Copy link

Hi, @apoorvumang, this work is so great!

I try to reproduce the reported MRR, MR and H@N results on Wikidata5M with evaluate.py, but I found it needs quite a long time. Could you please provide an estimation of the evaluation time for calculating MRR?

Thanks!

@apoorvumang
Copy link
Owner

Hi, thanks for your interest.

evaluate.py does evaluation in the 'traditional' sense - it calculates log probabilities of all entity sequences (5M) using the Transformer model and then ranks these entities. It does not generate predictions, hence the long time.

Please use the code in eval_accelerate.py for the sampling generation technique (which is described in the paper as well). evaluate.py is not the code used for the numbers reported in the paper, eval_accelerate.py is used. Please see the Readme for more details. I would be happy to clarify any other doubts as well.

@TamSiuhin
Copy link
Author

Thanks for your reply! But it seems that eval_accelerate.py just gives the unfiltered Hit@1, could you provide the official implementation for calculating MRR and filtered H@N? Appreciate your help!

@apoorvumang
Copy link
Owner

For that I would suggest you try the following:

  1. Switch to branch apoorv-dump instead of main. This contains the latest code but is not cleaned, hence the large number of files.
  2. In this branch, use eval_accelerate.py to evaluate (use sample size > 200). This saves all the generated predictions and scores to a scores file.
  3. Use notebook filtered_eval_from_scores.ipynb which uses these saved scores to evaluate MRR etc. I would suggest you go through the notebook to see the exact way these are calculated (if you see any issues please do contact me)

I will be cleaning the code/adding documentation etc. for this soon. Meanwhile I suggest you try the scores + notebook approach. Let me know if this works.

@TamSiuhin
Copy link
Author

It seems to work great! Thank you so much for your patience!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants