forked from newsreader/vua-srl-nl
-
Notifications
You must be signed in to change notification settings - Fork 1
/
run.sh
executable file
·32 lines (24 loc) · 900 Bytes
/
run.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
#!/bin/bash
# This script runs the Dutch SRL pipeline together
# it takes a NAF file with terms and Alpino dependencies as input
# and runs the data through timbl
# for more info, see the README
#
# author: Marieke van Erp
# date: 27 September 2014
# Update: 25 February 2015: new model
set -e
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
# [WvA] Create temp file for input and intermediate files
TMPFIL=`mktemp -t stap6.XXXXXX`
cat >$TMPFIL
TMPFILOUT=`mktemp -t stap6.XXXXXX`
TMPFILCSV=`mktemp -t stap6.XXXXXX`
# First step is to create a feature vector from the NAF file
python $DIR/nafAlpinoToSRLFeatures.py < $TMPFIL > $TMPFILCSV
timbl -mO:I1,2,3,4 -i $DIR/25Feb2015_e-mags_mags_press_newspapers.wgt -t $TMPFILCSV -o $TMPFILOUT +vs >&2;
# Insert the SRL values into the NAF file
python $DIR/timblToAlpinoNAF.py $TMPFIL $TMPFILOUT
rm $TMPFIL
rm $TMPFILOUT
rm $TMPFILCSV