[SRILM User List] Nbest list to lattice
Alfonso MHC
alfonso at iet.ntnu.no
Wed Aug 25 08:12:04 PDT 2010
Hello,
I'm trying to build a lattice in HTK format from a N-best list also in
HTK format.I have run a simple example where I start with this Nbest
list in the file ex2.nbest:
NBestList2.0
(0) c1 ( st: 0 et: 4 g: 0 a: 0 ) c2 ( st: 5 et: 10 g: 0 a: 0 )
(0) c3 ( st: 0 et: 1 g: 0 a: 0 ) c4 ( st: 1.01 et: 2 g: 0 a: 0 ) c5
( st: 2.1 et: 3 g: 0 a: 0 ) c6 ( st: 3.1 et: 4 g: 0 a: 0 ) c7 (
st: 4.1 et: 10 g: 0 a: 0 )
Given the time information, c1 happens at the same time as c3 c4 c5 c6,
and c2 happens at the same time as c7. Then I hope to obtain a lattice
that allows only four combinations:
c1 c2
c3 c4 c5 c6 c2
c1 c7
c3 c4 c5 c6 c7
However, the lattice I obtained allowed other paths and then I wonder if
I have missunderstood something. This is what I did:
To build the lattice I run:
./nbest-lattice -nbest ex2.nbest -use-mesh -write out2.lat
And get this lattice in out2.lat:
name ex2.nbest
numaligns 5
posterior 1
align 0 *DELETE* 0.5 c3 0.5
align 1 *DELETE* 0.5 c4 0.5
align 2 *DELETE* 0.5 c5 0.5
align 3 c1 0.5 c6 0.5
align 4 c2 0.5 c7 0.5
Then I build the HTK lattice with:
./lattice-tool -read-mesh -in-lattice out2.lat -out-lattice
out_htk_2.lat -write-htk
And get (I copy only the Links part...):
# Links
J=0 S=0 E=1 W=!NULL x1=-0.30103 a=-0.30103
J=1 S=0 E=1 W=c3 x1=-0.30103 a=-0.30103
J=2 S=1 E=2 W=!NULL x1=-0.30103 a=-0.30103
J=3 S=1 E=2 W=c4 x1=-0.30103 a=-0.30103
J=4 S=2 E=3 W=!NULL x1=-0.30103 a=-0.30103
J=5 S=2 E=3 W=c5 x1=-0.30103 a=-0.30103
J=6 S=3 E=4 W=c1 x1=-0.30103 a=-0.30103
J=7 S=3 E=4 W=c6 x1=-0.30103 a=-0.30103
J=8 S=4 E=5 W=c2 x1=-0.30103 a=-0.30103
J=9 S=4 E=5 W=c7 x1=-0.30103 a=-0.30103
It seems that this lattice allows other paths than the ones I expected,
e.g. c4 c1 c7. Then I think that the time information is not used how I
was expecting. Maybe I have not used the tools correctly or I have
missunderstod something. Could anyone let me know where the problem is?
Thanks in advance,
Alfonso
More information about the SRILM-User
mailing list