libTLK
1.3.1
|
Data Structures | |
struct | tLRecWord |
Recognized word. More... | |
struct | tLRecStats |
Recognition statistics. More... | |
Enumerations | |
enum | tLRecAlignType { TL_REC_ALIGN_NONE, TL_REC_ALIGN_WORDS, TL_REC_ALIGN_SYMS } |
Recognition alignment type. More... | |
Functions | |
tL_recogniser_free (tLRecogniser *rec) | |
Frees memory. | |
tL_recogniser_new (const tLAModel *amodel, const tLLexicon *lexicon, const tLLM *lm, const tLBool viterbi_states, const unsigned int wordgraph_density, const unsigned int lookahead_capacity, const unsigned int lookahead_depth, const unsigned int sil, char **err) | |
Gets a tLRecogniser. | |
tL_recognise (tLRecogniser *recogniser, const tLFea *fea, tLRecWord **rec, size_t *size, tLWordGraph **wg, tLRecStats *stats) | |
Recognizes a sample. |
enum tLRecAlignType |
tL_recognise | ( | tLRecogniser * | recogniser, |
const tLFea * | fea, | ||
tLRecWord ** | rec, | ||
size_t * | size, | ||
tLWordGraph ** | wg, | ||
tLRecStats * | 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 tLRecoWord with a NULL symbol 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 recognizer. |
fea | A feature vector manager, which must contain a sequence of feature vectors of an adequate type for the amodel. |
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 RecStats structure, used to store statistics from the recognition process. It can be NULL. |
tL_recogniser_free | ( | tLRecogniser * | rec | ) |
Frees memory.
Frees the memory allocated for the recognizer.
rec | The recognizer. |
tL_recogniser_new | ( | const tLAModel * | amodel, |
const tLLexicon * | lexicon, | ||
const tLLM * | lm, | ||
const tLBool | viterbi_states, | ||
const unsigned int | wordgraph_density, | ||
const unsigned int | lookahead_capacity, | ||
const unsigned int | lookahead_depth, | ||
const unsigned int | sil, | ||
char ** | err | ||
) |
Gets a tLRecogniser.
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 a 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.
amodel | The acoustic model. |
lexicon | The lexicon model. |
lm | The language model. |
viterbi_states | If TRUE, the viterbi approach is also applied inside the emission probability functions. |
wordgraph_density | A positive number indicates that a word graph with that number of incoming hypothesis in each state will be generated. A zero value indicates that no word graph will be generated. Currently, word graphs can only be generated using back-off LMs. |
lookahead_capacity | Indicates the capacity of the lookahead cache. A zero value means lookahead disabled. Currently, lookahead only works with back-off LMs. |
lookahead_depth | Indicates the depth of the n-grams used in look-ahead, i.e., 1 refers to unigrams, 2 for bigrams, etc. 0 to the order of the language model. |
sil | If it is a valid symbol (sil<amodel->N), it is the symbol used as silence, which would be inserted between words. Otherwise, any symbol is used as silence. |
err | Pointer to string variable. If not NULL, an error message is allocated in the variable in case of error. |