-
Notifications
You must be signed in to change notification settings - Fork 34
/
run_baseline.sh
executable file
·39 lines (33 loc) · 1.54 KB
/
run_baseline.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
#!/bin/bash
version="baseline"
# End-to-end evaluation:
# This is a demonstration on how to generate responses with the trained models
# The input files are knowledge.json and logs.json. labels.json is not required
# We use the validation data in this example.
# Prepare directories for intermediate results of each subtask
mkdir -p pred/val
# First we do knowledge-seeking turn detection on the test dataset
# Use --eval_dataset to specify the name of the dataset, in this case, val.
# Use --output_file to generate labels.json with predictions
# Specify --no_labels since there's no labels.json to read
python3 baseline.py --eval_only --checkpoint runs/ktd-${version}/ \
--eval_dataset val \
--dataroot data \
--no_labels \
--output_file pred/val/baseline.ktd.json
# Next we do knowledge selection based on the predictions generated previously
# Use --labels_file to take the results from the previous task
# Use --output_file to generate labels.json with predictions
python3 baseline.py --eval_only --checkpoint runs/ks-all-${version} \
--eval_all_snippets \
--dataroot data \
--eval_dataset val \
--labels_file pred/val/baseline.ktd.json \
--output_file pred/val/baseline.ks.json
# Finally we do response generation based on the selected knowledge
python3 baseline.py --generate runs/rg-hml128-kml128-${version} \
--generation_params_file baseline/configs/generation/generation_params.json \
--eval_dataset val \
--dataroot data \
--labels_file pred/val/baseline.ks.json \
--output_file baseline_val.json