-
Notifications
You must be signed in to change notification settings - Fork 4
/
pred.sh
28 lines (21 loc) · 967 Bytes
/
pred.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
#!/usr/bin/env bash
set -e
set -x
name=$1
data=$2
root=exp/nl2sql/$name
for split in dev
do
fpred=$root/${split}_pred.txt
feval=$root/${split}_eval.txt
ftest=$root/${split}_scores.txt
python predict.py $root/best.tar ${data}/${split}.json --tables ${data}/tables.json --db data/database --dcache cache/bert --output $fpred
python eval_scripts/evaluation.py --gold ${data}/${split}_gold.sql --pred $fpred --etype match --table ${data}/tables.json --db data/database > $feval
python predict.py $root/best.tar ${data}/${split}.json --tables ${data}/tables.json --db data/database --dcache cache/bert --output ${fpred}.avg --resumes $root/best.*.tar
python eval_scripts/evaluation.py --gold ${data}/${split}_gold.sql --pred ${fpred}.avg --etype match --table ${data}/tables.json --db data/database > ${feval}.avg
grep "exact match" $feval > $ftest
grep "exact match" ${feval}.avg > ${ftest}.avg
echo $split
cat $ftest
cat ${ftest}.avg
done