libak
0.4.0
|
Data Structures | |
struct | akRecWord |
Recognized word. More... | |
struct | akRecStats |
Recognition statistics. More... | |
Enumerations | |
enum | akRecAlignType { AK_REC_ALIGN_NONE, AK_REC_ALIGN_WORDS, AK_REC_ALIGN_SYMS } |
Recognition alignment type. More... | |
Functions | |
void | ak_recogniser_free (akRecogniser *rec) |
Frees memory. | |
akRecogniser * | ak_recogniser_new (const akCModel *cmodel, const akLexicon *lexicon, const akLM *lm, const akBool hmm_in_edges, const akBool viterbi_states, const unsigned int wordgraph_density, const unsigned int lookahead_capacity, const unsigned int sil, const akProb lpsil, char **err) |
Gets an akRecogniser. | |
int | ak_recognise (akRecogniser *recogniser, const akFea *fea, akRecWord **rec, size_t *size, akWordGraph **wg, akRecStats *stats) |
Recognizes a sample. |
enum akRecAlignType |
int ak_recognise | ( | akRecogniser * | recogniser, |
const akFea * | fea, | ||
akRecWord ** | rec, | ||
size_t * | size, | ||
akWordGraph ** | wg, | ||
akRecStats * | stats | ||
) |
Recognizes a sample.
This function finds the maximum probability path of a given sample, feature vector sequence, for a provided recognizer. The resulting recognition is returned into the variable rec. The recognition is terminated with a akRecoWord with a NULL character sequence. If rec points to NULL the needed memory is allocated and the number of allocated words is stored in the variable size. If rec doesn't point to NULL then rec will be reallocated if needed, according to the value stored in size, and the variable size will be updated.
recogniser | The recogniser. |
fea | A feature vector manager, which must contain a sequence of feature vectors of an adequate type for the cmodel. |
rec | Pointer to the address where the recognition will be stored. It can point to NULL. |
size | Memory address where the number of allocated words of the recognition is stored. |
wg | Pointer to the address of a word graph structure where the generated word graph will be stored. If the address is NULL a new word graph is allocated. The value of this variable is ignored if no word graph is generated during the recognition process. |
stats | Pointer to a aRecStats structure, used to store statistics from the recognition process. It can be NULL. |
void ak_recogniser_free | ( | akRecogniser * | rec | ) |
Frees memory.
Frees the memory allocated for the recognizer.
rec | The recognizer. |
akRecogniser* ak_recogniser_new | ( | const akCModel * | cmodel, |
const akLexicon * | lexicon, | ||
const akLM * | lm, | ||
const akBool | hmm_in_edges, | ||
const akBool | viterbi_states, | ||
const unsigned int | wordgraph_density, | ||
const unsigned int | lookahead_capacity, | ||
const unsigned int | sil, | ||
const akProb | lpsil, | ||
char ** | err | ||
) |
Gets an akRecogniser.
This function creates a recognizer used to recognize samples. By default recognition is carried out by embedding the HMMs into the states of the language model, however when the language model is a back-off model, HMMs can be optionally embedded into the edges and the lexicon internally represented as prefix tree, which can entail a faster recognition process. By default the Viterbi approach, that is, the replacement of operator by operator
, is only applied at state transition level. If desired, the Viterbi approach can be also applied to the emission probability functions. Currently supported types are: Bernoulli, DGaussian, Mixture and TiedStates.
cmodel | The character models. |
lexicon | The lexicon model. |
lm | The language model. |
hmm_in_edges | If TRUE HMMs are embedded into the edges instead of the states. |
viterbi_states | If TRUE the viterbi approach is also applied inside the emission probability functions. |
wordgraph_density | A positive number indicates that a wordgraph with that number of incoming hypothesis in each state will be generated. A zero value indicates that no wordgraph will be generated. Currently, wordgraphs only can be generated using hmm_in_edges. |
lookahead_capacity | Indicates the capacity of the look-ahead cache. A zero value means look-ahead disabled. Currently, look-ahead only works with hmm_in_edges. |
sil | If it is a valid symbol (sil<cmodel->N), it is the symbol used as silence, which would be inserted between words. In other case any symbol is used as silence. |
lpsil | Log-probability of inserting a silence symbol. |
err | Pointer to string variable. If not NULL an error message is allocated in the variable in case of error. |