Best results reproduction instruction #7
Comments
Hi, The --dev-file while training the retriever model should point to retriever/nq-dev.json file since it contains the pools of negative passages as well as positive ones. The 'qas' are basically just questions and answers which you need to use when doing the full evaluation (i.e against entire wikipedia). |
Just to be certain - the *.json files are not the splits used in the papers but the *.csv are? |
"the *.json files are not the splits used in the papers but the *.csv are? " - json are subsets of their csv counterparts since we lost some portion of data while preprocessing them. |
Hi there, Is there any instruction on the inference/test of the reader too? I'd like to use the provided checkpoint Thank you! |
Hi,
You are correct that you need to use data.retriever_results.nq.single.test as the input for validation. You should NOT use data.gold_passages_info.nq_test when doing inference. Here is an example of how we evaluate the reader on NQ test set: python train_reader.py --prediction_results_file {some dir}/results.json --eval_top_docs 10 20 40 50 80 100 --dev_file {path to data.retriever_results.nq.single.test file} --model_file {path to the reader checkpoint} --dev_batch_size 80 --passages_per_question_predict 100 --sequence_length 350 The example above is for 8x32GB gpu server. One should tune dev_batch_size for their hardware. |
Thanks for your detailed reply! I have obtained results close to those in the paper. |
hmm... Could you please sent the exact command you used? |
I simply reduced the dev_tacth_size, which took about 9GB in my case. I can also paste the whole output if you like, but I don't think I changed anything so.. |
"Loading checkpoint @ batch=1736 and epoch=18" - this is the correct one. |
Hi morningmoni , In the meantime you could use 'data.reader.nq.single.test' file instead of 'data.retriever_results.nq.single.test' to get those extra 0.1-0.2 accuracy. Note: the reader model is quite sensitive in all data preprocessing and hyperparameter settings. |
Thanks! I have got the same results when using the .pkl directly. Could you let me know when you say |
"Could you let me know when you say changing even one of the parameters," - basically all the hyper parameters for the reader training and data preprocessing ones: random seed, learning rate, gradient clip, and all reader data preparation settings which we don't expose yet via command line args(https://github.com/facebookresearch/DPR/blob/master/dpr/data/reader_data.py#L95) |
Hello,
I am trying to train a model based on your instructions and tried to run train_dense_encoder.py
In the instruction you are refering to
--dev_file {path to downloaded data.retriever.qas.nq-dev resource}
but it is unclear to which file you mean.Is it
retriever/qas/nq-dev.csv
orretriever/nq-dev.json
? The first option fails as the code expects a json file but the second one doesn't seem like a "retriever.qas" resource based on its name.The text was updated successfully, but these errors were encountered: