evaluate_retriever_nq.sh 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. #!/bin/bash
  2. # Evaluate natural question test data given Wikipedia embeddings and pretrained
  3. # ICT model or a finetuned model for Natural Question task
  4. # Datasets can be downloaded from the following link:
  5. # https://github.com/facebookresearch/DPR/blob/master/data/download_data.py
  6. EVIDENCE_DATA_DIR=<Specify path of Wikipedia dataset>
  7. EMBEDDING_PATH=<Specify path of the embeddings>
  8. CHECKPOINT_PATH=<Specify path of pretrained ICT model or finetuned model>
  9. QA_FILE=<Path of the natural question dev or test dataset>
  10. python tasks/main.py \
  11. --task RETRIEVER-EVAL \
  12. --tokenizer-type BertWordPieceLowerCase \
  13. --num-layers 12 \
  14. --hidden-size 768 \
  15. --num-attention-heads 12 \
  16. --tensor-model-parallel-size 1 \
  17. --micro-batch-size 128 \
  18. --checkpoint-activations \
  19. --seq-length 512 \
  20. --max-position-embeddings 512 \
  21. --load ${CHECKPOINT_PATH} \
  22. --evidence-data-path ${EVIDENCE_DATA_DIR} \
  23. --embedding-path ${EMBEDDING_PATH} \
  24. --retriever-seq-length 256 \
  25. --vocab-file bert-vocab.txt\
  26. --qa-data-test ${QA_FILE} \
  27. --faiss-use-gpu \
  28. --retriever-report-topk-accuracies 1 5 20 100 \
  29. --fp16 \
  30. --indexer-log-interval 1000 \
  31. --indexer-batch-size 128