NBest Class Reference
This class will translate recognition administration (a bunch of WLRType objects) into an N-Best list. More...
Public Member Functions | |
NBest (WLRType *path, char **voc, int stS, LanguageModel *lm, double orgLm, double orgTrP) | |
~NBest () | |
void | print (int max) |
void | setReference (WLRType *w) |
int | getScore (float lmScale, float transPenalty) |
Protected Member Functions | |
int | getNBestArraySize (WLRType *w, int *nrOfPaths) |
int | fillNBestArray (WLRType *w, NBestType *array, int *nr, int *emptyNr, int length) |
bool | printNextBest () |
bool | bigger (float lmScale, float transPenalty, float target) |
Protected Attributes | |
NBestList | reference |
char ** | vocabulary |
LanguageModel * | languageModel |
int | startOfSentenceWord |
double | org_LmScale |
double | org_transPenalty |
int | adminLength |
NBestList * | admin |
Detailed Description
This class will translate recognition administration (a bunch of WLRType objects) into an N-Best list.Constructor & Destructor Documentation
NBest::NBest | ( | WLRType * | path, | |
char ** | voc, | |||
int | stS, | |||
LanguageModel * | lm, | |||
double | orgLm, | |||
double | orgTrP | |||
) |
The constructor will create the N-Best list structure. The original WLR strings are flatten. For each sentence occurence, the one with the best AM score is retained, duplicates are removed.
- Todo:
- Do we need to check which duplicate is the best?
References admin, adminLength, NBestType::AM, fillNBestArray(), getNBestArraySize(), LanguageModel::getP(), languageModel, NBestType::LM, NBestList::noSilWords, NBestList::nrWords, org_LmScale, org_transPenalty, startOfSentenceWord, NBestList::totAM, NBestList::totLM, vocabulary, NBestType::wordID, and NBestList::wordList.

NBest::~NBest | ( | ) |
Destructor will delete the administration
References admin, adminLength, and NBestList::wordList.
Member Function Documentation
bool NBest::bigger | ( | float | lmScale, | |
float | transPenalty, | |||
float | target | |||
) | [protected] |
This method will return true if there is a hypothesis bigger than target that is not yet 'processed'
References admin, adminLength, NBestList::noSilWords, NBestList::processed, NBestList::totAM, and NBestList::totLM.
Referenced by getScore().
int NBest::fillNBestArray | ( | WLRType * | w, | |
NBestType * | array, | |||
int * | nr, | |||
int * | emptyNr, | |||
int | length | |||
) | [protected] |
Fills the array of the N-Best list.
References NBestType::AM, WLRType::COMBlikelihood, LanguageModel::getLastWordID(), LanguageModel::getP(), WLRType::isSil, languageModel, LM, NBestType::LM, WLRType::lmHistory, WLRType::nBest, org_LmScale, org_transPenalty, WLRType::previous, startOfSentenceWord, WLRType::timeStamp, WLRType::usedAt, and NBestType::wordID.
Referenced by NBest().

int NBest::getNBestArraySize | ( | WLRType * | w, | |
int * | nrOfPaths | |||
) | [protected] |
This method will determine how many words the longest path in the N-Best list contains and how big N is (nrOfPaths, unfiltered)
References WLRType::nBest, WLRType::previous, WLRType::timeStamp, and WLRType::usedAt.
Referenced by NBest().
int NBest::getScore | ( | float | lmScale, | |
float | transPenalty | |||
) |
Calculates the score of the reference with LM-scale lmScale..
References admin, adminLength, bigger(), NBestList::noSilWords, NBestList::processed, reference, NBestList::totAM, and NBestList::totLM.

void NBest::print | ( | int | max | ) |
Print the N-Best hypothesis (N == max)
References admin, adminLength, printNextBest(), and NBestList::processed.

bool NBest::printNextBest | ( | ) | [protected] |
Print the best hypothesis which is not just as good as 'upperLimit'...
References admin, adminLength, NBestList::noSilWords, NBestList::nrWords, org_LmScale, org_transPenalty, NBestList::processed, NBestList::totAM, NBestList::totLM, and vocabulary.
Referenced by print().
void NBest::setReference | ( | WLRType * | w | ) |
Sets a reference hypothese.
References WLRType::COMBlikelihood, LanguageModel::getLastWordID(), LanguageModel::getP(), WLRType::isSil, languageModel, WLRType::lmHistory, NBestList::noSilWords, NBestList::nrWords, org_LmScale, org_transPenalty, WLRType::previous, reference, WLRType::timeStamp, NBestList::totAM, and NBestList::totLM.

Member Data Documentation
NBestList* NBest::admin [protected] |
Referenced by bigger(), getScore(), NBest(), print(), printNextBest(), and ~NBest().
int NBest::adminLength [protected] |
Referenced by bigger(), getScore(), NBest(), print(), printNextBest(), and ~NBest().
LanguageModel* NBest::languageModel [protected] |
Referenced by fillNBestArray(), NBest(), and setReference().
double NBest::org_LmScale [protected] |
Referenced by fillNBestArray(), NBest(), printNextBest(), and setReference().
double NBest::org_transPenalty [protected] |
Referenced by fillNBestArray(), NBest(), printNextBest(), and setReference().
NBestList NBest::reference [protected] |
Referenced by getScore(), and setReference().
int NBest::startOfSentenceWord [protected] |
Referenced by fillNBestArray(), and NBest().
char** NBest::vocabulary [protected] |
Referenced by NBest(), and printNextBest().