Skip to content

Commit e96f989

Browse files
author
zhenzhen
committed
fftb commands with markdown
1 parent be03e22 commit e96f989

File tree

1 file changed

+29
-13
lines changed

1 file changed

+29
-13
lines changed

doc/treebanking.md

Lines changed: 29 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,53 @@
1-
#TREEBANKING TOOL fftb
1+
# TREEBANKING TOOL fftb
22

33
It uses ACE 0.9.23., which is in /home/zhenzhen/logon/lingo/answer/bin/linux.x86.64/ace
44
/home/zhenzhen/bin/ace is 0.9.24
5-
use [which ace] to find out ACE version
6-
[ code echo $PATH ] to see the PATH parameter values
5+
use `which ace` to find out ACE version
6+
`echo $PATH` to see the PATH parameter values
77
```
8-
export PATH=/home/zhenzhen/logon/lingo/answer/bin/linux.x86.64/:$PATH [to add the ace path to PATH]
8+
export PATH=/home/zhenzhen/logon/lingo/answer/bin/linux.x86.64/:$PATH
99
```
10+
to add the ace path to PATH
1011

1112
In ~/zhong/cmn/zhs
12-
1. make profile skeleton of the test suite first/home/zhenzhen/tools/fftrain-0.9.25/README
13-
mkprof -s tsdb/skeletons/cmnedu ~/treebank/cmnedu-20170724.2
13+
1. make profile skeleton of the test suite first (/home/zhenzhen/tools/fftrain-0.9.25/README)
14+
```mkprof -s tsdb/skeletons/cmnedu ~/treebank/cmnedu-20170724.2
15+
```
1416

1517
2.parse the profile/sentences to get trees
16-
art -f -a '/home/zhenzhen/logon/lingo/answer/bin/linux.x86.64/ace --disable-generalization -g zhs.dat -O' ~/treebank/cmnedu-20170724.2
18+
```art -f -a '/home/zhenzhen/logon/lingo/answer/bin/linux.x86.64/ace --disable-generalization -g zhs.dat -O' ~/treebank/cmnedu-20170724.2
19+
```
1720

1821
3. treebank with existing trees:
22+
```
1923
/home/zhenzhen/logon/lingo/answer/bin/linux.x86.64/fftb -g zhs.dat --browser --webdir=$LOGONROOT/lingo/answer/fftb --gold ~/treebank/cmnedu-20170724.3 ~/treebank/cmnedu-20170724.3
24+
```
2025

2126
when editing, use this to compile grammar:
27+
```
2228
/home/zhenzhen/logon/lingo/answer/bin/linux.x86.64/ace -G zhs_9.23.dat -g ace/config.tdl
29+
```
2330

31+
# Train a ranking model from treebank
2432

25-
Train a ranking model from treebank
26-
-----------------------------------
2733
compile grammar using ACE 0.9.25 first
28-
~/tools/ace-0.9.25/ace -G zhs.9.25.dat -g ace/config.tdl
29-
go to dir: ~/tools/fftrain-0.9.25
34+
```
35+
~/tools/ace-0.9.25/ace -G ~/zhong/cmn/zhs/zhs_9.25.dat -g ~/zhong/cmn/zhs/ace/config.tdl
36+
```
3037

38+
Create a master, then use a worker to train the model
39+
```
3140
FFGRANDPARENT=0 ./ffmaster 1 cmnedu.mem &
3241
FFGRANDPARENT=0 ./ffworker ~/zhong/cmn/zhs/zhs.9.25.dat ~/treebank/cmnedu-20170724.3 ~/treebank/cmnedu-20170724.3 localhost
33-
echo "我 刚才 去 邮局 给 我 妈妈 寄 了 点儿 东西 " | ~/tools/ace-0.9.25/ace -g ~/zhong/cmn/zhs/zhs.dat -1Tf --maxent=cmnedu.mem
42+
```
3443

44+
Testing the ranking model with one sentence, showing only the best parse (`-1Tf`). Use `-Tf` for all parses.
45+
```bash
46+
echo "我 刚才 去 邮局 给 我 妈妈 寄 了 点儿 东西 " | ~/tools/ace-0.9.25/ace -g ~/zhong/cmn/zhs/zhs.dat -1Tf --maxent=cmnedu.mem
47+
```
3548

49+
Another way to call the worker to train the model
50+
```
3651
FFGRANDPARENT=1 ./ffworker ~/zhong/cmn/zhs/zhs.dat ~/treebank/cmnedu-20170724.3 ~/treebank/cmnedu-20170724.3 localhost
37-
~/tools/ace-0.9.25/ace -G ~/zhong/cmn/zhs/zhs_9.25.dat -g ~/zhong/cmn/zhs/ace/config.tdl
52+
```
53+

0 commit comments

Comments
 (0)