Skip to content

Commit

Permalink
cleaning up scripts for eval and prediction
Browse files Browse the repository at this point in the history
  • Loading branch information
nitishgupta committed Sep 25, 2019
1 parent 19c833c commit d78fde8
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 116 deletions.
13 changes: 0 additions & 13 deletions scripts/allennlp/models/drop_bert/evaluate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,22 +49,9 @@ do
PREDICTION_FILE=${PREDICTION_DIR}/${EVAL_DATASET}_dev_pred.txt
VAL_EVALUATION_FILE=${PREDICTION_DIR}/${EVAL_DATASET}_dev_eval.txt
TEST_EVALUATION_FILE=${PREDICTION_DIR}/${EVAL_DATASET}_test_eval.txt
# PREDICTOR=drop_analysis_predictor
PREDICTOR=drop_parser_predictor

###################################################################################################################

# allennlp predict --output-file ${ANALYSIS_FILE} \
# allennlp predict --output-file ${PREDICTION_FILE} \
# --predictor ${PREDICTOR} \
# --cuda-device ${GPU} \
# --include-package ${INCLUDE_PACKAGE} \
# --silent \
# --batch-size 1 \
# --use-dataset-reader \
# --overrides "{"model": { "beam_size": ${BEAMSIZE}, "debug": ${DEBUG}}}" \
# ${MODEL_TAR} ${TESTFILE}

allennlp evaluate --output-file ${VAL_EVALUATION_FILE} \
--cuda-device ${GPU} \
--include-package ${INCLUDE_PACKAGE} \
Expand Down
32 changes: 2 additions & 30 deletions scripts/allennlp/models/drop_bert/predict.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ DATASET_DIR=./resources/data/drop/date_num
# 1. drop_dataset_mydev.json and drop_dataset_mytest.json
# 2. A folder containing multiple sub-dataset folders, each with dev and test .json
DATASET_NAME=date_ydNEW_num_hmyw_cnt_rel_600_10p
QUESTYPE_SETS_DIR=questype_datasets

FULL_VALFILE=${DATASET_DIR}/${DATASET_NAME}/drop_dataset_mydev.json
PREDICTION_FILE=${PREDICTION_DIR}/${DATASET_NAME}_dev_numstepanalysis.tsv
PREDICTOR=drop_analysis_predictor
# PREDICTOR=drop_parser_predictor

allennlp predict --output-file ${PREDICTION_FILE} \
--predictor ${PREDICTOR} \
Expand All @@ -32,32 +32,4 @@ allennlp predict --output-file ${PREDICTION_FILE} \
--batch-size 1 \
--use-dataset-reader \
--overrides "{"model": { "beam_size": ${BEAMSIZE}, "debug": ${DEBUG}}}" \
${MODEL_TAR} ${FULL_VALFILE}



#for EVAL_DATASET in datecomp_full year_diff_re count how_many_yards_was who_relocate_re numcomp_full
#do
# VALFILE=${DATASET_DIR}/${DATASET_NAME}/${QUESTYPE_SETS_DIR}/${EVAL_DATASET}/drop_dataset_mydev.json
#
# # ANALYSIS_FILE=${PREDICTION_DIR}/${EVAL_DATASET}_dev_analysis.tsv
# PREDICTION_FILE=${PREDICTION_DIR}/${EVAL_DATASET}_dev_numstepanalysis.tsv
# # PREDICTION_FILE=${PREDICTION_DIR}/${EVAL_DATASET}_dev_pred.txt
# PREDICTOR=drop_analysis_predictor
# # PREDICTOR=drop_parser_predictor
#
# ###################################################################################################################
#
# # allennlp predict --output-file ${PREDICTION_FILE} \
# allennlp predict --output-file ${PREDICTION_FILE} \
# --predictor ${PREDICTOR} \
# --cuda-device ${GPU} \
# --include-package ${INCLUDE_PACKAGE} \
# --silent \
# --batch-size 1 \
# --use-dataset-reader \
# --overrides "{"model": { "beam_size": ${BEAMSIZE}, "debug": ${DEBUG}}}" \
# ${MODEL_TAR} ${VALFILE}
#
# echo -e "Predictions file saved at: ${PREDICTION_FILE}"
#done
${MODEL_TAR} ${FULL_VALFILE}
60 changes: 0 additions & 60 deletions scripts/allennlp/models/drop_bert/predict_test.sh

This file was deleted.

13 changes: 0 additions & 13 deletions scripts/allennlp/models/drop_parser/evaluate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,22 +49,9 @@ do
PREDICTION_FILE=${PREDICTION_DIR}/${EVAL_DATASET}_dev_pred.txt
VAL_EVALUATION_FILE=${PREDICTION_DIR}/${EVAL_DATASET}_dev_eval.txt
TEST_EVALUATION_FILE=${PREDICTION_DIR}/${EVAL_DATASET}_test_eval.txt
# PREDICTOR=drop_analysis_predictor
PREDICTOR=drop_parser_predictor

###################################################################################################################

# allennlp predict --output-file ${ANALYSIS_FILE} \
# allennlp predict --output-file ${PREDICTION_FILE} \
# --predictor ${PREDICTOR} \
# --cuda-device ${GPU} \
# --include-package ${INCLUDE_PACKAGE} \
# --silent \
# --batch-size 1 \
# --use-dataset-reader \
# --overrides "{"model": { "beam_size": ${BEAMSIZE}, "debug": ${DEBUG}}}" \
# ${MODEL_TAR} ${TESTFILE}

allennlp evaluate --output-file ${VAL_EVALUATION_FILE} \
--cuda-device ${GPU} \
--include-package ${INCLUDE_PACKAGE} \
Expand Down

0 comments on commit d78fde8

Please sign in to comment.