ONNX-Demo / pyserini /resources /index-metadata /faiss.mrtydi-v1.1.20220523.7b099d5.mdpr-tied-pft-nq.README.md
ArthurChen189's picture
upload pyserini
62977bb
|
raw
history blame
2.07 kB

mrtydi-v1.1-arabic (trained on NQ)

Faiss flat index for Mr.TyDi v1.1 (Arabic), using mDPR fine-tuned on NQ.

This index was generated on 2022/05/23 at commit 7b099d5 on basilisk with the following command:

lang=arabic # any language in Mr. TyDi

tarfn=mrtydi-v1.1-$lang.tar.gz
corpus=mrtydi-v1.1-$lang/collection/docs.jsonl
index_dir=mrtydi-mdpr-dindex-msmarco/$lang

wget https://git.uwaterloo.ca/jimmylin/mr.tydi/-/raw/master/data/$tarfn
tar –xvf $tarfn
gzip -cvf $corpus.gz > $corpus

shard_num=1
encoder=castorini/mdpr-tied-pft-nq

for shard_id in $(seq 0 `$shard_num - 1`) ; do
    index_dir=mdpr-dindex/$lang-$shard_id
    mkdir -p $index_dir
    python -m pyserini.encode   input   --corpus $corpus \
                                        --fields title text \
                                        --delimiter "\n\n" \
                                        --shard-id $shard_id \
                                        --shard-num $shard_num \
                                output  --embeddings  $index_dir \
                                        --to-faiss \
                                encoder --encoder $encoder \
                                        --fields title text \
                                        --batch 128 \
                                        --encoder-class 'auto' \
                                        --fp16
done

Note that the delimiter are only supported after Pyserini #1000.

Here's a sample retrieval command (on the test set):

set_name=test
python -m pyserini.search.faiss \
  --encoder castorini/mdpr-tied-pft-msmarco \
  --topics mrtydi-v1.1-${lang}-${set_name} \
  --index ${index_dir} \
  --output runs/run.mrtydi-v1.1-$lang.${set_name}.txt \
  --batch-size 36 \
  --threads 12 \
  --encoder-class 'auto'