UCDP-AEC

Models and data for the UCDP Abstractive Event analysis Corpus paper
git clone https://esimon.eu/repos/UCDP-AEC.git
Log | Files | Refs | README | LICENSE

run_eval.bash (1113B)


      1 export device="0"
      2 export model_path=""
      3 export data_name=data/text2tree/one_ie_ace2005_subtype
      4 export task_name="event"
      5 export batch=1
      6 export decoding_format='tree'
      7 
      8 while getopts "b:d:m:i:t:co:f:" arg; do
      9   case $arg in
     10   b)
     11     batch=$OPTARG
     12     ;;
     13   d)
     14     device=$OPTARG
     15     ;;
     16   m)
     17     model_path=$OPTARG
     18     ;;
     19   i)
     20     data_folder=$OPTARG
     21     ;;
     22   t)
     23     task_name=$OPTARG
     24     ;;
     25   f)
     26     decoding_format=$OPTARG
     27     ;;
     28   c)
     29     constraint_decoding="--constraint_decoding"
     30     ;;
     31   o)
     32     extra_cmd=$OPTARG
     33     ;;
     34   ?)
     35     echo "unkonw argument"
     36     exit 1
     37     ;;
     38   esac
     39 done
     40 
     41 echo "Extra CMD: " "${extra_cmd}"
     42 
     43 CUDA_VISIBLE_DEVICES=${device} python run_seq2seq.py \
     44   --do_eval --do_predict --task=${task_name} --predict_with_generate \
     45   --validation_file=${data_folder}/val.json \
     46   --test_file=${data_folder}/test.json \
     47   --event_schema=${data_folder}/event.schema \
     48   --model_name_or_path=${model_path} \
     49   --output_dir="${model_path}"_eval \
     50   --source_prefix="${task_name}: " \
     51   ${constraint_decoding} ${extra_cmd} \
     52   --per_device_eval_batch_size=${batch} \
     53   --decoding_format ${decoding_format}