未验证 提交 4200cc94 编写于 作者: J Jacek Czaja 提交者: GitHub

- Added an option to run sentiment classification for CPU and selected (#4652)

上级 450160e8
......@@ -9,15 +9,19 @@ 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 \
......@@ -33,10 +37,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 \
......@@ -48,10 +53,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 \
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册