-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile.EvalUD
51 lines (41 loc) · 1.74 KB
/
Makefile.EvalUD
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
ALUD=~/bin/alud
ALUD_OPTIONS=-t -d -x
EVAL=$(ALPINO_HOME)/UD2.0/conll17_ud_eval.py -v
GOODKEYS=python3 $(ALPINO_HOME)/EvalUD/goodkeys.py
compare: $(SUITES:%=%.compare)
parse: $(SUITES:%=%.log)
%.log:
$(MAKE) annotate suite=$*
annotate:
mkdir -p $(suite)
$(ALPINO_HOME)/src/Alpino -notk cmdint=off\
-veryfast\
user_max=600000 debug=1\
xml_format_frame=on\
xml_format_failed_parse=on\
display_main_parts=off\
display_quality=off\
-flag suite $(SUITESDIR)/$(suite)\
-flag treebank $(suite)\
demo=off\
end_hook=xml $(extra)\
$($(suite)_test1_options)\
batch_command="parser_comparisons" 2> $(suite).log
%.conllu: %/*.xml $(ALUD)
ls -v $*/*.xml | $(ALUD) $(ALUD_OPTIONS) > $*.conllu 2> $*.conllu.err
%.conllu.cln: %.conllu $(CONLLU)/%.conllu
$(GOODKEYS) $(CONLLU)/$*.conllu $*.conllu > $*.conllu.cln
%.compare: $(CONLLU)/%.conllu %.conllu.cln
$(EVAL) $(CONLLU)/$*.conllu $*.conllu.cln > $*.compare
analyse:
@echo "mean per corpus results; does not take into account size of corpora"
@grep UPOS *.compare | awk '{ N=N+1; T = T + $$9 } END { print "UPOS\t" T/N }'
@grep XPOS *.compare | awk '{ N=N+1; T = T + $$9 } END { print "XPOS\t" T/N }'
@grep Feats *.compare | awk '{ N=N+1; T = T + $$9 } END { print "Feats\t" T/N }'
@grep AllTags *.compare | awk '{ N=N+1; T = T + $$9 } END { print "AllTags\t" T/N }'
@grep Lemmas *.compare | awk '{ N=N+1; T = T + $$9 } END { print "Lemmas\t" T/N }'
@grep UAS *.compare | awk '{ N=N+1; T = T + $$9 } END { print "UAS\t" T/N }'
@grep LAS *.compare | awk '{ N=N+1; T = T + $$9 } END { print "LAS\t" T/N }'
clean:
rm -f $(SUITES:%=%.compare) $(SUITES:%=%.log) $(SUITES:%=%.conllu.cln)
rm -rf $(SUITES)