-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile.bitext_stats
46 lines (39 loc) · 3.2 KB
/
makefile.bitext_stats
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
SHELL=/bin/bash
DATA_SET = train
DATA_ID = pcedt
DATA_VERSION := $(shell cat data/analysed/$(DATA_ID)/$(DATA_SET)/last_id 2> /dev/null || echo 0000)
DATA_DIR=data/analysed/$(DATA_ID)/$(DATA_SET)/$(DATA_VERSION)
JOBS_NUM = 50
ifeq (${DATA_SET}, train)
JOBS_NUM = 100
endif
LRC=1
ifeq (${LRC}, 1)
LRC_FLAGS = -p --qsub '-hard -l mem_free=8G -l act_mem_free=8G -l h_vmem=8G' --jobs ${JOBS_NUM}
endif
cs_relpron_stats :
-treex $(LRC_FLAGS) -Lcs \
Read::Treex from=@$(DATA_DIR)/list \
Util::SetGlobal selector=ref \
Project::Attributes layer=t alignment_type=monolingual alignment_direction=trg2src attributes=gram/indeftype \
My::BitextCorefStats::AddRobustAlignmentRelpron selector=ref \
My::BitextCorefStats::CsRelpron selector=ref to='.' substitute='{^.*/([^\/]*)}{tmp/stats/cs_relpron/$$1.txt}'
find tmp/stats/cs_relpron -path "*.txt" -exec cat {} \; > tmp/stats/cs_relpron.all
#cat tmp/stats/cs_relpron.all | grep "^coref_cover" | cut -f2 | distr > analysis/cs.relpron/$(DATA_SET).$(DATA_ID)/coref_cover.ref.freq
#cat stats/bitext_coref_stats | grep "^cs_relpron_scores" | cut -f2 | scripts/eval.pl > analysis/cs.relpron/$(DATA_SET).$(DATA_ID)/scores.all
#cat stats/bitext_coref_stats | grep "^cs_relpron_scores" | cut -f2,3 | grep "^0" | cut -f2 > analysis/cs.relpron/$(DATA_SET).$(DATA_ID)/nodes.0_ref.list
#cat tmp/stats/cs_relpron.all | grep "^en_counterparts" | cut -f2 | distr > analysis/cs.relpron/$(DATA_SET).$(DATA_ID)/en_counterparts.ref.freq
#cat stats/bitext_coref_stats | grep "^cs_relpron_tlemma" | cut -f2 | distr > analysis/cs.relpron/$(DATA_SET).$(DATA_ID)/tlemma.freq
#cat stats/bitext_coref_stats | grep "^cs_relpron_ante_agree" | cut -f2 | scripts/eval.pl | sed 's/PRE/ali\/cs/' | sed 's/REC/ali\/en/' | sed '/ACC/d;sed/F-M/d' > analysis/cs.relpron/$(DATA_SET).$(DATA_ID)/ante_agree.all.scores
cat tmp/stats/cs_relpron.all | grep "^ante_agree" | cut -f2 | distr > analysis/cs.relpron/$(DATA_SET).$(DATA_ID)/ante_agree.ref.freq
en_perspron_stats :
-treex $(LRC_FLAGS) -Len -Ssrc \
Read::Treex from=@$(DATA_DIR)/list \
My::BitextCorefStats::EnPerspron align_selector=$(ALIGN_SELECTOR) to='.' substitute='{^.*/([^\/]*)}{tmp/stats/en_perspron/$$1.txt}'
find tmp/stats/en_perspron -path "*.txt" -exec cat {} \; > tmp/stats/en_perspron.all
#cat stats/bitext_coref_stats | grep "^cs_relpron_scores" | cut -f2 | scripts/eval.pl > analysis/cs.relpron/$(DATA_SET).$(DATA_ID)/scores.all
#cat stats/bitext_coref_stats | grep "^cs_relpron_scores" | cut -f2,3 | grep "^0" | cut -f2 > analysis/cs.relpron/$(DATA_SET).$(DATA_ID)/nodes.0_ref.list
#cat stats/bitext_coref_stats | grep "^cs_relpron_en_counterparts" | cut -f2 | distr > analysis/cs.relpron/$(DATA_SET).$(DATA_ID)/en_counterparts.freq
#cat stats/bitext_coref_stats | grep "^cs_relpron_tlemma" | cut -f2 | distr > analysis/cs.relpron/$(DATA_SET).$(DATA_ID)/tlemma.freq
#cat stats/bitext_coref_stats | grep "^cs_relpron_ante_agree" | cut -f2 | scripts/eval.pl | sed 's/PRE/ali\/cs/' | sed 's/REC/ali\/en/' | sed '/ACC/d;sed/F-M/d' > analysis/cs.relpron/$(DATA_SET).$(DATA_ID)/ante_agree.all.scores
cat tmp/stats/en_perspron.all | grep "^en_perspron_cs_counterparts" | cut -f2 | distr > analysis/en.perspron/$(DATA_SET).$(DATA_ID)/cs.$(ALIGN_SELECTOR).counterparts.freq