-
Notifications
You must be signed in to change notification settings - Fork 1
/
run_ngram_models.sh
executable file
·49 lines (41 loc) · 1.33 KB
/
run_ngram_models.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
38
39
40
41
42
43
44
45
46
47
48
#!/bin/bash
#$ -wd /home/aadelucia/files/minerva/emnlp_wnut_2020
#$ -N ngram-model
#$ -j y -o $JOB_NAME-$JOB_ID.out
#$ -M [email protected]
#$ -l ram_free=5G,mem_free=5G
# Activate dev environments and call programs
export LD_LIBRARY_PATH=:/opt/NVIDIA/cuda-10/lib64/
export CUDA_VISIBLE_DEVICES=$(free-gpu -n 1)
source /home/jsech1/miniconda3/bin/activate minerva-proj
# Define input directory, temp directory, and path to final feature output file
WORKING_DIR="${MINERVA_HOME}/emnlp_wnut_2020"
INPUT_FILE="${WORKING_DIR}/ignore/labelled_tweets_is_protest_event.csv"
# Only keywords
python "${WORKING_DIR}/ngram_model.py" \
--input-file "${INPUT_FILE}" \
--results-file "${WORKING_DIR}/keyword_model_results_${JOB_ID}.pkl" \
--save-model-path "${WORKING_DIR}/keyword_model_${JOB_ID}.pkl" \
--keywords-file "${WORKING_DIR}/keywords_english.txt" \
--seed 42
# Check exit status
status=$?
if [ $status -ne 0 ]
then
echo "Program failed"
exit 1
fi
# All unigrams
python "${WORKING_DIR}/ngram_model.py" \
--input-file "${INPUT_FILE}" \
--results-file "${WORKING_DIR}/unigram_model_results_${JOB_ID}.pkl" \
--save-model-path "${WORKING_DIR}/unigram_model_${JOB_ID}.pkl" \
--max-iter 4000 \
--seed 42
# Check exit status
status=$?
if [ $status -ne 0 ]
then
echo "Program failed"
exit 1
fi