-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile.train
34 lines (27 loc) · 995 Bytes
/
Makefile.train
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
CORPUS = corpus.train
TEST = corpus.test
MODEL = mecab-model
SEEDDIR = .
ALGO = crf
FREQ = 1
C = 1.0
EVAL = 0 1 2 4
LIBEXECDIR = `mecab-config --libexecdir`
BINDIR = `mecab-config --prefix`/bin
RMODEL = $(MODEL).c$(C).f$(FREQ)
DICDIR = $(RMODEL).dic
all: mkseed train mkdic test
mkseed:
$(LIBEXECDIR)/mecab-dict-index -d $(SEEDDIR) -o $(SEEDDIR)
train:
$(LIBEXECDIR)/mecab-cost-train -a $(ALGO) -y -c $(C) -d $(SEEDDIR) -f $(FREQ) $(CORPUS) $(RMODEL).model
$(LIBEXECDIR)/mecab-cost-train -d $(SEEDDIR) -b $(RMODEL).model.txt $(RMODEL).model
mkdic:
mkdir -p $(DICDIR)
$(LIBEXECDIR)/mecab-dict-gen -a $(ALGO) -d $(SEEDDIR) -m $(RMODEL).model -o $(DICDIR)
$(LIBEXECDIR)/mecab-dict-index -d $(DICDIR) -o $(DICDIR)
test:
$(LIBEXECDIR)/mecab-test-gen $(TEST) | $(BINDIR)/mecab -r /dev/null -d $(DICDIR) -o $(RMODEL).result
$(LIBEXECDIR)/mecab-system-eval -l "$(EVAL)" $(RMODEL).result $(TEST) | tee $(RMODEL).score
clean:
rm -f $(RMODEL)* $(DICDIR)