Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Makeing script more flexible #4681

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions PaddleNLP/sentiment_classification/run.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,18 @@ TASK_NAME='senta'
DATA_PATH=./senta_data/
CKPT_PATH=./save_models
MODEL_PATH=./save_models/step_1800/
MODEL_TYPE=${MODEL_TYPE:-bilstm_net}
USE_CUDA=${USE_CUDA:-true}

# run_train on train.tsv and do_val on test.tsv
train() {
python -u run_classifier.py \
--task_name ${TASK_NAME} \
--use_cuda true \
--use_cuda $USE_CUDA \
--do_train true \
--do_val false \
--do_infer false \
--model_type $MODEL_TYPE \
--batch_size 8 \
--data_dir ${DATA_PATH} \
--vocab_path ${DATA_PATH}/word_dict.txt \
Expand All @@ -33,10 +36,11 @@ train() {
evaluate() {
python -u run_classifier.py \
--task_name ${TASK_NAME} \
--use_cuda true \
--use_cuda $USE_CUDA \
--do_train false \
--do_val true \
--do_infer false \
--model_type $MODEL_TYPE \
--batch_size 10 \
--data_dir ${DATA_PATH} \
--vocab_path ${DATA_PATH}/word_dict.txt \
Expand All @@ -48,10 +52,11 @@ evaluate() {
infer() {
python -u run_classifier.py \
--task_name ${TASK_NAME} \
--use_cuda true \
--use_cuda $USE_CUDA \
--do_train false \
--do_val false \
--do_infer true \
--model_type $MODEL_TYPE \
--batch_size 10 \
--data_dir ${DATA_PATH} \
--vocab_path ${DATA_PATH}/word_dict.txt \
Expand Down