-
Notifications
You must be signed in to change notification settings - Fork 0
/
eval.sh
49 lines (46 loc) · 1.19 KB
/
eval.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
while getopts ":d:t:m:s:c:" opt
do
case $opt in
d)
DATASET="$OPTARG"
;;
t)
TRAINED_DATASET="$OPTARG"
;;
m)
MODEL_TYPE="$OPTARG"
;;
s)
DECODING_STRATEGY="$OPTARG"
;;
c)
CHECKPOINT="$OPTARG"
;;
?)
echo "未知参数"
exit 1;;
esac
done
echo '-------- evaluate on dataset: '"$DATASET"'--------'
PROJECT_PATH='.'
DATA_DIR=${PROJECT_PATH}/data/finetune/${DATASET}
PRED_FILE=${DATA_DIR}/infer/${TRAINED_DATASET}/${MODEL_TYPE}/${DECODING_STRATEGY}_${CHECKPOINT}_pred.txt
if [ "$DATASET" == "dailydialog" ]; then
python3 utils/evaluate.py \
-name dailydialog \
-hyp "${PRED_FILE}" \
-ref "${DATA_DIR}"/processed/test.tgt
elif [ "$DATASET" == "empatheticdialog" ]; then
python3 utils/evaluate.py \
-name empatheticdialog \
-hyp "${PRED_FILE}" \
-ref "${DATA_DIR}"/processed/test.tgt
elif [ "$DATASET" == "empatheticdialog_annotated" ]; then
python3 utils/evaluate.py \
-name empatheticdialog_annotated \
-hyp "${PRED_FILE}" \
-ref "${DATA_DIR}"/processed/dialog/test.tgt
else
echo 'dataset '"$DATASET"' not found!'
exit 1
fi