IR_Project / Retriever /bash_retr.sh
Lk123's picture
Upload 18 files
83c2bac verified
raw
history blame contribute delete
685 Bytes
#!/bin/bash
export CUDA_VISIBLE_DEVICES=0
QUESTION_FILE="../data/webq-test.txt" # 问题测试集
EMBEDDING_FILE="../corpus/ctx_embeddings.pkl" # 语料库的embedding
INDEX_PATH="../index/webq_index" # 语料库的faiss索引
OUTPUT_FILE="../output/result.pkl" # 检索结果输出
BATCH_SIZE=32
MODEL_NAME="facebook/dpr-question_encoder-multiset-base" # 将问题编码为embedding的模型
DEVICE="cuda"
python retriever.py \
--questions_file $QUESTION_FILE \
--context_embeddings_file $EMBEDDING_FILE \
--model_name $MODEL_NAME \
--index_path $INDEX_PATH\
--output_file $OUTPUT_FILE \
--batch_size $BATCH_SIZE \
--top_docs 100 \
--device $DEVICE