htk-words-on-nodes option in lattice-tool

Andreas Stolcke stolcke at speech.sri.com
Thu Apr 12 22:44:32 PDT 2007


jpinto at idiap.ch wrote:
> Hello,
>
> I have a phoneme lattice (obtained from NOWAY decoder) with phoneme
> tokens on the links (edges). I wish to convert this to HTK format with
> phoneme info on nodes and I do the following:
>
> lattice-tool -in-lattice input.lat -read-htk -write-htk -out-lattice
> output.lattice -htk-words-on-nodes
>
> I observe that the output lattice has more number of nodes & links
> (NODES=448 LINKS=766) compared to the input lattice (N=65   L=383)
>
> when I dont give the option -htk-words-on-nodes, nodes and links remain
> the same.
>
> I dont understand why the number of nodes and links should increase. Am I
> missing something ? Any help in this regard would be very helpful.
>   
That's because when you move attributes from links to nodes you might 
have to duplicate nodes to create
an equivalent lattice.  In fact, the way SRILM reads HTK lattices is by 
converting each link to a node,
thereby enabling the -htk-words-on-nodes mapping.  Unfortunately, the 
code is not smart enough to
avoid the duplication even when it is not really necessary given how the 
links are originally labeled.

Note: lattice-tool is not meant to be a general HTK lattice format 
manipulation tool. You would think HTK has
better tools for that.

Andreas






More information about the SRILM-User mailing list