-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathparse_udpipe.sh
More file actions
executable file
·28 lines (25 loc) · 965 Bytes
/
parse_udpipe.sh
File metadata and controls
executable file
·28 lines (25 loc) · 965 Bytes
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
#!/usr/bin/env bash
#SBATCH --mem=10G
#SBATCH --time=0-3
#SBATCH --array=0-13
DIR=$PWD
. models.sh
echo SLURM_ARRAY_TASK_ID=$SLURM_ARRAY_TASK_ID
[[ -n "$SLURM_ARRAY_TASK_ID" ]] && CORPORA=(${CORPORA[$SLURM_ARRAY_TASK_ID]})
for d in ${CORPORA[@]}; do
echo $d
rm -fv $PARSED/conllu/${UDPIPE_MODEL[$d]}/$d.conllu
data=${DATA[$d]}
if [[ -z "$data" ]]; then
echo No UCCA data found for $d, using UD data instead as input
data=${UD_DATA[$d]}
fi
if [[ -z "$data" ]]; then
echo No UD input data found for $d
else
echo $data
run python -m semstr.scripts.udpipe $data -u ../udpipe/models/${UDPIPE_MODEL[$d]} -o $PARSED/conllu/${UDPIPE_MODEL[$d]} -j $d.tmp $*
run ../udpipe/udpipe-ud-2.3-181115/udpipe --tag --parse ../udpipe/udpipe-ud-2.3-181115/${UDPIPE_MODEL[$d]} < $PARSED/conllu/${UDPIPE_MODEL[$d]}/$d.tmp.conllu > $PARSED/conllu/${UDPIPE_MODEL[$d]}/$d.conllu
rm -f $PARSED/conllu/${UDPIPE_MODEL[$d]}/$d.tmp.conllu
fi
done