|
1 |
| -#TREEBANKING TOOL fftb |
| 1 | +# TREEBANKING TOOL fftb |
2 | 2 |
|
3 | 3 | It uses ACE 0.9.23., which is in /home/zhenzhen/logon/lingo/answer/bin/linux.x86.64/ace
|
4 | 4 | /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 |
7 | 7 | ```
|
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 |
9 | 9 | ```
|
| 10 | +to add the ace path to PATH |
10 | 11 |
|
11 | 12 | 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 | +``` |
14 | 16 |
|
15 | 17 | 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 | +``` |
17 | 20 |
|
18 | 21 | 3. treebank with existing trees:
|
| 22 | +``` |
19 | 23 | /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 | +``` |
20 | 25 |
|
21 | 26 | when editing, use this to compile grammar:
|
| 27 | +``` |
22 | 28 | /home/zhenzhen/logon/lingo/answer/bin/linux.x86.64/ace -G zhs_9.23.dat -g ace/config.tdl
|
| 29 | +``` |
23 | 30 |
|
| 31 | +# Train a ranking model from treebank |
24 | 32 |
|
25 |
| -Train a ranking model from treebank |
26 |
| ------------------------------------ |
27 | 33 | 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 | +``` |
30 | 37 |
|
| 38 | +Create a master, then use a worker to train the model |
| 39 | +``` |
31 | 40 | FFGRANDPARENT=0 ./ffmaster 1 cmnedu.mem &
|
32 | 41 | 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 | +``` |
34 | 43 |
|
| 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 | +``` |
35 | 48 |
|
| 49 | +Another way to call the worker to train the model |
| 50 | +``` |
36 | 51 | 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