PocketSphinx
5.0.0
A small speech recognizer
|
Word graph structure used in bestpath/nbest search. More...
#include <pocketsphinx/lattice.h>
Public Member Functions | |
POCKETSPHINX_EXPORT ps_lattice_t * | ps_lattice_read (struct ps_decoder_s *ps, char const *file) |
POCKETSPHINX_EXPORT ps_lattice_t * | ps_lattice_retain (ps_lattice_t *dag) |
POCKETSPHINX_EXPORT int | ps_lattice_free (ps_lattice_t *dag) |
POCKETSPHINX_EXPORT int | ps_lattice_write (ps_lattice_t *dag, char const *filename) |
POCKETSPHINX_EXPORT int | ps_lattice_write_htk (ps_lattice_t *dag, char const *filename) |
POCKETSPHINX_EXPORT logmath_t * | ps_lattice_get_logmath (ps_lattice_t *dag) |
POCKETSPHINX_EXPORT ps_latnode_iter_t * | ps_latnode_iter (ps_lattice_t *dag) |
POCKETSPHINX_EXPORT void | ps_lattice_link (ps_lattice_t *dag, ps_latnode_t *from, ps_latnode_t *to, int32 score, int32 ef) |
POCKETSPHINX_EXPORT ps_latlink_t * | ps_lattice_traverse_edges (ps_lattice_t *dag, ps_latnode_t *start, ps_latnode_t *end) |
POCKETSPHINX_EXPORT ps_latlink_t * | ps_lattice_traverse_next (ps_lattice_t *dag, ps_latnode_t *end) |
POCKETSPHINX_EXPORT ps_latlink_t * | ps_lattice_reverse_edges (ps_lattice_t *dag, ps_latnode_t *start, ps_latnode_t *end) |
POCKETSPHINX_EXPORT ps_latlink_t * | ps_lattice_reverse_next (ps_lattice_t *dag, ps_latnode_t *start) |
POCKETSPHINX_EXPORT ps_latlink_t * | ps_lattice_bestpath (ps_lattice_t *dag, ngram_model_t *lmset, float32 lwf, float32 ascale) |
POCKETSPHINX_EXPORT int32 | ps_lattice_posterior (ps_lattice_t *dag, ngram_model_t *lmset, float32 ascale) |
POCKETSPHINX_EXPORT int32 | ps_lattice_posterior_prune (ps_lattice_t *dag, int32 beam) |
POCKETSPHINX_EXPORT int | ps_lattice_n_frames (ps_lattice_t *dag) |
Word graph structure used in bestpath/nbest search.
POCKETSPHINX_EXPORT ps_lattice_t * ps_lattice_read | ( | struct ps_decoder_s * | ps, |
char const * | file | ||
) |
Read a lattice from a file on disk.
ps | Decoder to use for processing this lattice, or NULL. |
file | Path to lattice file. |
POCKETSPHINX_EXPORT ps_lattice_t * ps_lattice_retain | ( | ps_lattice_t * | dag | ) |
Retain a lattice.
This function retains ownership of a lattice for the caller, preventing it from being freed automatically. You must call ps_lattice_free() to free it after having called this function.
POCKETSPHINX_EXPORT int ps_lattice_free | ( | ps_lattice_t * | dag | ) |
Free a lattice.
POCKETSPHINX_EXPORT int ps_lattice_write | ( | ps_lattice_t * | dag, |
char const * | filename | ||
) |
Write a lattice to disk.
POCKETSPHINX_EXPORT int ps_lattice_write_htk | ( | ps_lattice_t * | dag, |
char const * | filename | ||
) |
Write a lattice to disk in HTK format
POCKETSPHINX_EXPORT logmath_t * ps_lattice_get_logmath | ( | ps_lattice_t * | dag | ) |
Get the log-math computation object for this lattice
POCKETSPHINX_EXPORT ps_latnode_iter_t * ps_latnode_iter | ( | ps_lattice_t * | dag | ) |
Start iterating over nodes in the lattice.
dag | Lattice to iterate over. |
POCKETSPHINX_EXPORT void ps_lattice_link | ( | ps_lattice_t * | dag, |
ps_latnode_t * | from, | ||
ps_latnode_t * | to, | ||
int32 | score, | ||
int32 | ef | ||
) |
Create a directed link between "from" and "to" nodes, but if a link already exists, choose one with the best link_scr.
POCKETSPHINX_EXPORT ps_latlink_t * ps_lattice_traverse_edges | ( | ps_lattice_t * | dag, |
ps_latnode_t * | start, | ||
ps_latnode_t * | end | ||
) |
Start a forward traversal of edges in a word graph.
dag | Lattice to be traversed. |
start | Start node (source) of traversal. |
end | End node (goal) of traversal. |
POCKETSPHINX_EXPORT ps_latlink_t * ps_lattice_traverse_next | ( | ps_lattice_t * | dag, |
ps_latnode_t * | end | ||
) |
Get the next link in forward traversal.
dag | Lattice to be traversed. |
end | End node (goal) of traversal. |
POCKETSPHINX_EXPORT ps_latlink_t * ps_lattice_reverse_edges | ( | ps_lattice_t * | dag, |
ps_latnode_t * | start, | ||
ps_latnode_t * | end | ||
) |
Start a reverse traversal of edges in a word graph.
dag | Lattice to be traversed. |
start | Start node (goal) of traversal. |
end | End node (source) of traversal. |
POCKETSPHINX_EXPORT ps_latlink_t * ps_lattice_reverse_next | ( | ps_lattice_t * | dag, |
ps_latnode_t * | start | ||
) |
Get the next link in reverse traversal.
dag | Lattice to be traversed. |
start | Start node (goal) of traversal. |
POCKETSPHINX_EXPORT ps_latlink_t * ps_lattice_bestpath | ( | ps_lattice_t * | dag, |
ngram_model_t * | lmset, | ||
float32 | lwf, | ||
float32 | ascale | ||
) |
Do N-Gram based best-path search on a word graph.
This function calculates both the best path as well as the forward probability used in confidence estimation.
POCKETSPHINX_EXPORT int32 ps_lattice_posterior | ( | ps_lattice_t * | dag, |
ngram_model_t * | lmset, | ||
float32 | ascale | ||
) |
Calculate link posterior probabilities on a word graph.
This function assumes that bestpath search has already been done.
POCKETSPHINX_EXPORT int32 ps_lattice_posterior_prune | ( | ps_lattice_t * | dag, |
int32 | beam | ||
) |
Prune all links (and associated nodes) below a certain posterior probability.
This function assumes that ps_lattice_posterior() has already been called.
beam | Minimum posterior probability for links. This is expressed in the log-base used in the decoder. To convert from linear floating-point, use logmath_log(ps_lattice_get_logmath(), prob). |
POCKETSPHINX_EXPORT int ps_lattice_n_frames | ( | ps_lattice_t * | dag | ) |
Get the number of frames in the lattice.
dag | The lattice in question. |