evaluate_retriever_nq.sh 1.21 KB
Newer Older
Mostofa Patwary's avatar
Mostofa Patwary committed
1
2
3
#!/bin/bash

# Evaluate natural question test data given Wikipedia embeddings and pretrained
4
# ICT model or a finetuned model for Natural Question task
Mostofa Patwary's avatar
Mostofa Patwary committed
5
6
7
8
9
10

# Datasets can be downloaded from the following link:
# https://github.com/facebookresearch/DPR/blob/master/data/download_data.py

EVIDENCE_DATA_DIR=<Specify path of Wikipedia dataset>
EMBEDDING_PATH=<Specify path of the embeddings>
11
CHECKPOINT_PATH=<Specify path of pretrained ICT model or finetuned model>
Mostofa Patwary's avatar
Mostofa Patwary committed
12

13
QA_FILE=<Path of the natural question dev or test dataset>
Mostofa Patwary's avatar
Mostofa Patwary committed
14

15
python tasks/main.py \
16
    --task RETRIEVER-EVAL \
17
    --tokenizer-type BertWordPieceLowerCase \
Mostofa Patwary's avatar
Mostofa Patwary committed
18
19
20
21
22
    --num-layers 12 \
    --hidden-size 768 \
    --num-attention-heads 12 \
    --tensor-model-parallel-size 1 \
    --micro-batch-size 128 \
23
    --activations-checkpoint-method uniform \
Mostofa Patwary's avatar
Mostofa Patwary committed
24
25
26
27
28
29
30
31
32
33
    --seq-length 512 \
    --max-position-embeddings 512 \
    --load ${CHECKPOINT_PATH} \
    --evidence-data-path ${EVIDENCE_DATA_DIR} \
    --embedding-path ${EMBEDDING_PATH} \
    --retriever-seq-length 256 \
    --vocab-file  bert-vocab.txt\
    --qa-data-test ${QA_FILE} \
    --faiss-use-gpu \
    --retriever-report-topk-accuracies 1 5 20 100 \
Mostofa Patwary's avatar
Mostofa Patwary committed
34
35
36
37
    --fp16 \
    --indexer-log-interval 1000 \
    --indexer-batch-size 128

Mostofa Patwary's avatar
Mostofa Patwary committed
38