forked from dwadden/multivers
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpredict.sh
108 lines (100 loc) · 3.73 KB
/
predict.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
# Make model predictions.
function predict_rob_scifact() {
python multivers/predict.py \
--checkpoint_path=checkpoints/scifact.ckpt \
--input_file=data/rob_data/sg/claims_test_retrieved.jsonl \
--corpus_file=data/rob_data/sg/corpus.jsonl \
--output_file=prediction/rob_data.jsonl
}
function predict_rob_scifact_exact_sentences() {
python multivers/predict.py \
--checkpoint_path=checkpoints/scifact.ckpt \
--input_file=data/rob_data/sg/claims_test_retrieved_with_exact_sentences.jsonl \
--corpus_file=data/rob_data/sg/corpus.jsonl \
--output_file=prediction/rob_data_exact_sentences.jsonl
}
function predict_rob_d1_scifact_new_claims() {
python multivers/predict.py \
--checkpoint_path=checkpoints/scifact.ckpt \
--input_file=data/rob_data/sg/claims_test_retrieved_new_claims.jsonl \
--corpus_file=data/rob_data/sg/corpus.jsonl \
--output_file=prediction/rob_data_new_claims.jsonl
}
function predict_rob_d2_scifact() {
python multivers/predict.py \
--checkpoint_path=checkpoints/scifact.ckpt \
--input_file=data/rob_data/ac_domain_2/claims_test_retrieved.jsonl \
--corpus_file=data/rob_data/ac_domain_2/corpus.jsonl \
--output_file=prediction/ac_domain_2.jsonl
}
function predict_rob_d3_scifact() {
python multivers/predict.py \
--checkpoint_path=checkpoints/scifact.ckpt \
--input_file=data/rob_data/incomplete_domain_3/claims_test_retrieved.jsonl \
--corpus_file=data/rob_data/incomplete_domain_3/corpus.jsonl \
--output_file=prediction/incomplete_domain_3.jsonl
}
function predict_rob_d4_scifact() {
python multivers/predict.py \
--checkpoint_path=checkpoints/scifact.ckpt \
--input_file=data/rob_data/blinding_domain_4/claims_test_retrieved.jsonl \
--corpus_file=data/rob_data/blinding_domain_4/corpus.jsonl \
--output_file=prediction/blinding_domain_4.jsonl
}
function predict_scifact() {
python multivers/predict.py \
--checkpoint_path=checkpoints/scifact.ckpt \
--input_file=data/scifact/claims_test_retrieved.jsonl \
--corpus_file=data/scifact/corpus.jsonl \
--output_file=prediction/scifact.jsonl
}
function predict_healthver() {
python multivers/predict.py \
--checkpoint_path=checkpoints/healthver.ckpt \
--input_file=data/healthver/claims_test.jsonl \
--corpus_file=data/healthver/corpus.jsonl \
--output_file=prediction/healthver.jsonl
}
function predict_covidfact() {
# NOTE: For covidfact, many of the claims are paper titles (or closely
# related). To avoid data leakage for this dataset, we evaluate using a
# version of the corpus with titles removed.
python multivers/predict.py \
--checkpoint_path=checkpoints/covidfact.ckpt \
--input_file=data/covidfact/claims_test.jsonl \
--corpus_file=data/covidfact/corpus_without_titles.jsonl \
--output_file=prediction/covidfact.jsonl
}
########################################
model=$1
mkdir -p prediction
if [[ $model == "rob_scifact" ]]
then
predict_rob_scifact
elif [[ $model == "rob_scifact_exact_sentences" ]]
then
predict_rob_scifact_exact_sentences
elif [[ $model == "rob_d1_scifact_new_claims" ]]
then
predict_rob_d1_scifact_new_claims
elif [[ $model == "rob_d2_scifact" ]]
then
predict_rob_d2_scifact
elif [[ $model == "rob_d3_scifact" ]]
then
predict_rob_d3_scifact
elif [[ $model == "rob_d4_scifact" ]]
then
predict_rob_d4_scifact
elif [[ $model == "scifact" ]]
then
predict_scifact
elif [[ $model == "covidfact" ]]
then
predict_covidfact
elif [[ $model == "healthver" ]]
then
predict_healthver
else
echo "Allowed options are: {scifact,covidfact,healthver}."
fi