Lattices in HTK are used for storing multiple hypotheses from the output of a speech recogniser and for specifying finite state syntax networks for recognition. The HTK standard lattice format (SLF) is designed to be extensible and to be able to serve a variety of purposes. However, in order to facilitate the transfer of lattices , it incorporates a core set of common features.
An SLF file can contain zero or more sub-lattices followed by a main lattice. Sub-lattices are used for defining sub-networks prior to their use in subsequent sub-lattices or the main lattice. They are identified by the presence of a SUBLAT field and they are terminated by a single period on a line by itself.
A lattice consists of optional header information followed by a sequence of node definitions and a sequence of links (arc) definitions. Nodes and links are numbered and the first definition line must give the total number of each.
Each link represents a word instance occurring between two nodes, however for more compact storage the nodes often hold the word labels since these are frequently common to all words entering a node (the node effectively represents the end of several word instances). This is also used in lattices representing word-level networks where each node is a word end, and each arc is a word transition.
Each node may optionally be labelled with a word hypothesis and with a time. Each link has a start and end node number and may optionally be labelled with a word hypothesis (including the pronunciation variant, acoustic score and segmentation of the word hypothesis) and a language model score.