libTLK  1.3.1
Data Structures | Typedefs | Functions
Classification of samples
Algorithms

Data Structures

struct  tLClassHyp
 Classification hypothesis. More...

Typedefs

typedef void( tLClassifyCallback )(void *udata, tLProb prob_class, tLProb prob_lexicon, tLProb prob_sample, size_t class, const tLSeq *cs)
 Callback function for tL_classify.

Functions

 tL_classifier_free (tLClassifier *cls)
 Frees memory.
 tL_classifier_new (const tLAModel *amodel, const tLLexicon *lexicon, const tLPriors *priors, tLClassifyCallback *callback, void *udata, char **err)
 Gets a Classifier.
 tL_classify (tLClassifier *cls, const tLFea *fea, tLClassHyp *hyps, const unsigned int N)
 Classifies a sample.

Typedef Documentation

typedef void( tLClassifyCallback)(void *udata,tLProb prob_class,tLProb prob_lexicon,tLProb prob_sample,size_t class,const tLSeq *cs)

Callback function for tL_classify.

This callback is used to capture probability $p(c)p(e\mid c)p(x\mid e)$ for every symbol sequence.


Function Documentation

tL_classifier_free ( tLClassifier *  cls)

Frees memory.

Frees the memory allocated for the classifier.

Parameters:
clsThe classifier.
tL_classifier_new ( const tLAModel amodel,
const tLLexicon lexicon,
const tLPriors priors,
tLClassifyCallback callback,
void *  udata,
char **  err 
)

Gets a Classifier.

This function creates a classifier used to classify samples. Currently supported types are: Bernoulli, DGaussian, Mixture and TiedStates.

Parameters:
amodelThe acoustic model used to classify.
lexiconThe lexicon used to classify.
priorsThe prior probabilities used to classify.
callbackA callback function used to capture the calculated probabilities during the classification process. It can be NULL.
errPointer to string variable. If not NULL, an error message is allocated in the variable in case of error.
udataUser data passed to the callback function.
Returns:
Classifier, or NULL in case of error.
tL_classify ( tLClassifier *  cls,
const tLFea fea,
tLClassHyp hyps,
const unsigned int  N 
)

Classifies a sample.

This function classifies the given sample, feature vector sequence, according to the next expression: $(c,e)^*=\arg\max_{(c,e)} p(c)p(e\mid c)p(x\mid e)\, $ where $x$ is the given sample and $(c,e)$ is a valid pair of symbol sequence and class. The probability $p(x\mid e)$ is approximated using the Viterbi algorithm. This function can be used to obtain the N most probable $(c,e)$ pairs or hypotheses. The variable hyps must contain enough memory to allocate N hypotheses.

Parameters:
clsThe classifier.
feaA feature vector manager, which must contain a sequence of feature vectors of an adequate type for the amodel.
hypsAn array with enough memory to allocate the required hypotheses.
NNumber of required hypotheses.
Returns:
The number of hypotheses returned.
 All Data Structures Variables