-
Notifications
You must be signed in to change notification settings - Fork 2
/
runTest.sh
executable file
·94 lines (80 loc) · 3.26 KB
/
runTest.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
#!/bin/bash
# reg: $1
#************************************ PREPROCESSING *******************************************#
suffix=$1;
infix=test
source "$(dirname `readlink -f ${0}`)/training/config.sh"
pwd
training_dir_old=${datadir}/naacl2012_splits/from_dipanjan/another_set
#processedfile=${training_dir_old}/cv.${infix}.sentences.all.lemma.tags
processedfile_new=${datadir}/naacl2012_splits/mstparsed_by_me/cv.${infix}.sentences.all.lemma.tags
processedfile=$processedfile_new
#tokenizedfile=${training_dir_old}/cv.${infix}.sentences.tokenized
tokenizedfile=${datadir}/naacl2012_splits/mstparsed_by_me/cv.${infix}.sentences.tokenized
fefile=${training_dir_old}/cv.${infix}.sentences.frame.elements
framesfile_new=${datadir}/naacl2012_splits/from_dipanjan/cv.${infix}.sentences.frames
relation_modified_file="${SEMAFOR_HOME}/../framenet_data/frRelationModified.xml";
frames_single_file="${SEMAFOR_HOME}/../framenet_data/framesSingleFile.xml";
echo ${CLASSPATH}
echo ${CLASSPATH_OLD}
#temp=temp_frust_fn_lus/on_fn
#temp=temp_siblings/on_fn
#temp=temp_siblings_fn_lus/on_fn
#temp=temp_ancestors_fn_lus/on_fn
#temp=temp_lus_only/on_fn
#temp=temp_ancestors/on_fn
temp=temp_adadelta_fn_with_lus/on_fn
mkdir -p ${temp}
echo "temp directory: $temp"
end=`wc -l ${tokenizedfile}`
end=`expr ${end% *}`
echo "Start:0"
echo "End:${end}"
#**********************************ARGUMENT IDENTIFICATION********************************************#
#$JAVA_HOME_BIN/java -classpath ${CLASSPATH} -Xms4000m -Xmx4000m edu.cmu.cs.lti.ark.fn.parsing.CreateAlphabet \
#${framesfile_new} \
#${processedfile_new} \
#${temp}/file.fe.events.bin \
#${model_dir}/scan/parser.conf.unlabeled \
#${temp}/file.frame.elements.spans \
#false \
#1 \
#null > /tmp/test.spans.out
#exit;
$JAVA_HOME_BIN/java -classpath ${CLASSPATH_OLD} -Xms4000m -Xmx4000m edu.cmu.cs.lti.ark.fn.parsing.DecodingMainArgs \
${model_dir}/svm.argmodel.dat \
${model_dir}/scan/parser.conf.unlabeled \
${temp}/file.fe.events.bin \
${temp}/file.frame.elements.spans \
${temp}/file.predict.frame.elements \
${fefile} \
overlapcheck > /tmp/output ## nooverlapcheck to get Naive search results
#exit;
#**********************************END OF ARGUMENT IDENTIFICATION********************************************#
#rm -rf $temp/file.gold.frame.elements
cat ${fefile} | awk '{print "0""\t"$0}' > $temp/file.gold.frame.elements
$JAVA_HOME_BIN/java -classpath ${CLASSPATH_OLD} -Xms1000m -Xmx1000m edu.cmu.cs.lti.ark.fn.evaluation.PrepareFullAnnotationXML \
testFEPredictionsFile:$temp/file.predict.frame.elements \
startIndex:0 \
endIndex:${end} \
testParseFile:${processedfile} \
testTokenizedFile:${tokenizedfile} \
outputFile:$temp/file.predict.xml
$JAVA_HOME_BIN/java -classpath ${CLASSPATH_OLD} -Xms1000m -Xmx1000m edu.cmu.cs.lti.ark.fn.evaluation.PrepareFullAnnotationXML \
testFEPredictionsFile:$temp/file.gold.frame.elements \
startIndex:0 \
endIndex:${end} \
testParseFile:${processedfile} \
testTokenizedFile:${tokenizedfile} \
outputFile:$temp/file.gold.xml
echo "Exact Results"
perl ${SEMAFOR_HOME}/scripts/scoring/fnSemScore_modified.pl -c ${temp} \
-l \
-n \
-e \
-v \
${frames_single_file} ${relation_modified_file} \
$temp/file.gold.xml \
$temp/file.predict.xml > evaluation/results/argid_${infix}_ll_beam_1_exact_verbose_${suffix}
#rm -rf ${temp}
#rm -rf ${SEMAFOR_HOME}/${temp}