f.fancellu <astromantic3@...> writes:
> Hi,
> I am currently building a HPBM to translate from Chinese to English and I
was wondering if there is a script already available to extract from a trace
the rules used when translating a sentence and visualize them in a clear way.
Hi,
I have some extra debugging code locally, which shows the source range, plus
the target side of each rule. Here's an example EN--DE with target-side
syntax ('Q', 'root', 'pred', 'det' are all nonterminals):
echo "This is a test ." | ~/moses/bin/moses_chart -v 2
AddXmlChartOptions 0
0 1 2 3 4 5 6
1 15 20 20 17 17 0
13 984 1000 748 597 0
200 869 869 859 0
200 810 838 0
53 801 0
34 0
1
BEST TRANSLATION: 24225 Q </s> :0-0 : c=-0.333
core=(0.000,-1.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000) [0..6]
22845 [total=-1.980]
core=(-19.024,-7.000,0.000,-1.991,-2.089,-2.465,-6.951,4.000,1.000,0.000)
24225: Q => Q </s> [0..6] | 22845
22845: Q => Q root [0..5] | 0 18098
0: Q => <s> [0..0] |
18098: root => Dies ist pred [1..5] | 7811
7811: pred => det Test root [3..5] | 37 73
37: det => ein [3..3] |
73: root => . [5..5] |
Dies ist ein Test .
the numbers at the start and end of the lines are hypothesis IDs; hypothesis
7811 has two NTs, which are translated in hypotheses 37 and 73.
I can send you the code, or push it to Moses if other people are interested.
_______________________________________________
Moses-support mailing list
[email protected]
http://mailman.mit.edu/mailman/listinfo/moses-support