NBest Class Reference

This class will translate recognition administration (a bunch of WLRType objects) into an N-Best list. More...

List of all members.


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
LanguageModellanguageModel
int startOfSentenceWord
double org_LmScale
double org_transPenalty
int adminLength
NBestListadmin

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.

Here is the call graph for this function:

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]

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.

Here is the call graph for this function:

void NBest::print ( int  max  ) 

Print the N-Best hypothesis (N == max)

References admin, adminLength, printNextBest(), and NBestList::processed.

Here is the call graph for this function:

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().


Member Data Documentation

double NBest::org_LmScale [protected]

Referenced by getScore(), and setReference().

int NBest::startOfSentenceWord [protected]

Referenced by fillNBestArray(), and NBest().

char** NBest::vocabulary [protected]

Referenced by NBest(), and printNextBest().