After fine-tuning BERT on SQUAD, how do I test what output it gives
After fine-tuning BERT on SQUAD, how do I test what output it gives for a particular passage and question? Also, isn't "dev-v1.1.json" the file on which predictions are made. Why does it have multiple answers? There should be none right? Since we're trying to make predictions on them. Looking forward to a solution to this.
Figured.
@apurvaasf I think you'd better to share the solution to help the others who meet the same question.
Hey @cliuxinxin, sure! So once you fine-tune BERT on Squad by running "run_squad.py", you'll have a fine-tuned model in "/tmp/squad_base". So now you change the init_checkpoint to "/tmp/squad_base/model.ckpt-29199"(or whichever model.ckpt you wanna try. I just tried with the last one). And remove do_train from the parameters while running "run_squad.py" this time. So now when you run "run_squad.py", it only makes predictions on the file you give as input in "predict_file" and saves it to "output_dir".
About the second question, "predict_file" doesn't really need to have answers. I don't know why dev-v1.1.json has answers, but your predict file can have just passages and questions, and no answers.
Hope it helps.
@apurvaasf thank you for your time. I think this will help some lost souls:)
Hi, @apurvaasf can you please share your predict_file?
@apurvaasf how much time does it take to fine tune the pre-trained BERT base uncased model on SQuAD v1.1 dataset in colab with GPU?