-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrun_endtoend.sh
executable file
·37 lines (33 loc) · 1.1 KB
/
run_endtoend.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
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License").
# You may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
TASK="$1"
if [ "$TASK" = "insurance" ]
then
TASK="insurance"
elif [ "$TASK" = "fastfood" ]
then
TASK="fastfood"
else
exit 1
fi
MODEL_TYPE="bert"
MODEL_DIR="results_multilabel/${TASK}"
RESULT_FILENAME="predict_test.txt"
echo "Model path = ${MODEL_DIR}"
cd MultilabelBERT
# Training
python3 main.py --task $TASK --model_type $MODEL_TYPE --model_dir "../${MODEL_DIR}" --do_train --do_eval
# Predicting
python3 predict.py --model_dir "../${MODEL_DIR}" --output_file "../${MODEL_DIR}/${RESULT_FILENAME}"
cd ..