bert icon indicating copy to clipboard operation
bert copied to clipboard

After fine-tuning BERT on SQUAD, how do I test what output it gives

Open apurvaasf opened this issue 8 years ago • 6 comments

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.

apurvaasf avatar Nov 27 '18 11:11 apurvaasf

Figured.

apurvaasf avatar Nov 27 '18 14:11 apurvaasf

@apurvaasf I think you'd better to share the solution to help the others who meet the same question.

cliuxinxin avatar Nov 28 '18 06:11 cliuxinxin

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 avatar Nov 29 '18 07:11 apurvaasf

@apurvaasf thank you for your time. I think this will help some lost souls:)

cliuxinxin avatar Nov 29 '18 07:11 cliuxinxin

Hi, @apurvaasf can you please share your predict_file?

funlabscloud avatar Apr 27 '19 05:04 funlabscloud

@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?

itsjatinsharma avatar Jul 16 '20 11:07 itsjatinsharma