libTLK
1.3.1
|
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 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 for every symbol sequence.
tL_classifier_free | ( | tLClassifier * | cls | ) |
Frees memory.
Frees the memory allocated for the classifier.
cls | The 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.
amodel | The acoustic model used to classify. |
lexicon | The lexicon used to classify. |
priors | The prior probabilities used to classify. |
callback | A callback function used to capture the calculated probabilities during the classification process. It can be NULL. |
err | Pointer to string variable. If not NULL, an error message is allocated in the variable in case of error. |
udata | User data passed to the callback function. |
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: where
is the given sample and
is a valid pair of symbol sequence and class. The probability
is approximated using the Viterbi algorithm. This function can be used to obtain the N most probable
pairs or hypotheses. The variable hyps must contain enough memory to allocate N hypotheses.
cls | The classifier. |
fea | A feature vector manager, which must contain a sequence of feature vectors of an adequate type for the amodel. |
hyps | An array with enough memory to allocate the required hypotheses. |
N | Number of required hypotheses. |