libak  0.4.0
Data Structures | Enumerations | Functions
Recognition of samples

Data Structures

struct  akRecWord
 Recognized word. More...
struct  akRecStats
 Recognition statistics. More...


 Recognition alignment type. More...


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.

Enumeration Type Documentation

Recognition alignment type.

Type of alignment using during recognition.


Recognize without aligning.


Aligns words.


Aligns words and symbols.

Function Documentation

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.

recogniserThe recogniser.
feaA feature vector manager, which must contain a sequence of feature vectors of an adequate type for the cmodel.
recPointer to the address where the recognition will be stored. It can point to NULL.
sizeMemory address where the number of allocated words of the recognition is stored.
wgPointer 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.
statsPointer to a aRecStats structure, used to store statistics from the recognition process. It can be NULL.
0 if the sample has been recognized, -1 in other case.
void ak_recogniser_free ( akRecogniser *  rec)

Frees memory.

Frees the memory allocated for the recognizer.

recThe 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 $\sum$ by operator $\max$, 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.

cmodelThe character models.
lexiconThe lexicon model.
lmThe language model.
hmm_in_edgesIf TRUE HMMs are embedded into the edges instead of the states.
viterbi_statesIf TRUE the viterbi approach is also applied inside the emission probability functions.
wordgraph_densityA 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_capacityIndicates the capacity of the look-ahead cache. A zero value means look-ahead disabled. Currently, look-ahead only works with hmm_in_edges.
silIf 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.
lpsilLog-probability of inserting a silence symbol.
errPointer to string variable. If not NULL an error message is allocated in the variable in case of error.
Auxiliary data or NULL in case of error.
 All Data Structures Variables