Skip to content

Minor fixes to run some of your codes#3

Open
yoshitomo-matsubara wants to merge 6 commits intohuminghao16:masterfrom
yoshitomo-matsubara:master
Open

Minor fixes to run some of your codes#3
yoshitomo-matsubara wants to merge 6 commits intohuminghao16:masterfrom
yoshitomo-matsubara:master

Conversation

@yoshitomo-matsubara
Copy link
Copy Markdown

@yoshitomo-matsubara yoshitomo-matsubara commented Jul 11, 2019

Hello,

First of all, thank you for sharing your code!

I tried to reproduce results in your paper, and found there are two different "data" folders (one at user home, one at the same level of src folder), which caused some errors like FileNotFoundError

With my minor fixes (including README.md) and the following scripts, there will be only one data folder (at the same level of src folder), and we can complete tasks for SQuAD-doc, TriviaQA-wiki, and TriviaQA-open.

# Python 3.6 and torch==1.1.0 were used
export DATA_DIR=data/squad
export BERT_DIR=bert-base-uncased

python -m bert.run_squad_document_full_e2e \
  --vocab_file $BERT_DIR/vocab.txt \
  --bert_config_file $BERT_DIR/bert_config.json \
  --init_checkpoint $BERT_DIR/pytorch_model.bin \
  --do_train \
  --do_predict \
  --data_dir $DATA_DIR \
  --train_file train-v1.1.json \
  --predict_file dev-v1.1.json \
  --train_batch_size 16 \
  --learning_rate 3e-5 \
  --num_train_epochs 2.0 \
  --output_dir out/squad_doc/01

python -m bert.run_squad_document_full_e2e \
  --vocab_file $BERT_DIR/vocab.txt \
  --bert_config_file $BERT_DIR/bert_config.json \
  --do_predict_open \
  --data_dir $DATA_DIR \
  --output_dir out/squad_doc/01

python -m triviaqa.evidence_corpus --n_processes 8 --max_tokens 200
python -m triviaqa.build_span_corpus wiki --n_processes 8
python -m triviaqa.build_span_corpus unfiltered --n_processes 8

python -m triviaqa.ablate_triviaqa_wiki --n_processes 8 --n_para_train 12 --n_para_dev 14 --n_para_test 14 --do_train --do_dev --do_test
python -m triviaqa.ablate_triviaqa_unfiltered --n_processes 8 --n_para_train 12 --n_para_dev 14 --n_para_test 14 --do_train --do_dev --do_test
cp data/triviaqa/qa/wikipedia-dev.json data/triviaqa/wiki/
cp data/triviaqa-unfiltered/unfiltered-web-dev.json data/triviaqa/unfiltered/

export DATA_DIR=data/triviaqa/wiki
export BERT_DIR=bert-base-uncased

python -m bert.run_triviaqa_wiki_full_e2e  \
  --vocab_file $BERT_DIR/vocab.txt \
  --bert_config_file $BERT_DIR/bert_config.json \
  --init_checkpoint $BERT_DIR/pytorch_model.bin \
  --do_train \
  --do_dev \
  --data_dir $DATA_DIR \
  --train_batch_size 16 \
  --learning_rate 3e-5 \
  --num_train_epochs 2.0 \
  --output_dir out/triviaqa_wiki/01

export DATA_DIR=data/triviaqa/unfiltered
export BERT_DIR=bert-base-uncased

python -m bert.run_triviaqa_wiki_full_e2e  \
  --vocab_file $BERT_DIR/vocab.txt \
  --bert_config_file $BERT_DIR/bert_config.json \
  --init_checkpoint $BERT_DIR/pytorch_model.bin \
  --do_train \
  --do_dev \
  --data_dir $DATA_DIR \
  --dev_file unfiltered-web-dev.json \
  --train_batch_size 16 \
  --learning_rate 3e-5 \
  --num_train_epochs 2.0 \
  --output_dir out/triviaqa_unfiltered/01

Note: At first I tried to set 32 at train_batch_size for both models as suggested, but faced CUDA out of memory error even with 4 GPUs (each of them has 16GB video memory), so used 16 as train_batch_size

Regardless of my minor fixes, I faced a different error for SQuAD-open, but couldn't fix it shortly.
I will submit issues with some additional questions, and put the links here later.

Thank you!

@Arjunsankarlal
Copy link
Copy Markdown

Hey there @yoshitomo-matsubara that's a great work! it would be very helpful if you could upload the trained models.

@yoshitomo-matsubara
Copy link
Copy Markdown
Author

Hey there @yoshitomo-matsubara that's a great work! it would be very helpful if you could upload the trained models.

Hi @Arjunsankarlal
I don't have trained models to reproduce the reported results, sorry

Hi @huminghao16
#4 and #5 are my additional questions, thanks!

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

Successfully merging this pull request may close these issues.

2 participants