FreeLing  4.0
Public Member Functions | Private Member Functions | Private Attributes
freeling::smoothingLD< G, E > Class Template Reference

Class smoothingLD computes linear-discount smoothed conditional probabilities P(z|w1...wn) for n-gram transitions. More...

#include <smoothingLD.h>

Inheritance diagram for freeling::smoothingLD< G, E >:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 smoothingLD (const std::wstring &cfgFile, const std::map< std::wstring, E > &esc=std::map< std::wstring, E >())
 Constructor, load data from config file.
 ~smoothingLD ()
 destructor
double Prob (const G &ngram, const E &z) const
 Compute smoothed conditional log prob of seeing symbol z following given ngram P(z|ngram)

Private Member Functions

double count (const G &ngram) const

Private Attributes

double alpha
 log alpha and 1-alpha parameter for linear discount
double notalpha
std::map< G, double > counts
 map to store ngram counts (for any size of ngram)
double pUnseen
double nobs
size_t order
 order of the n-gram model. Order=3 => trigram model P(z|xy)
std::map< std::wstring, E > escapes
 translation table for escaped symbols in input (e.g. ,
, ...)

Detailed Description

template<class G, class E>
class freeling::smoothingLD< G, E >

Class smoothingLD computes linear-discount smoothed conditional probabilities P(z|w1...wn) for n-gram transitions.

template parameters:


Constructor & Destructor Documentation

template<class G, class E>
freeling::smoothingLD< G, E >::smoothingLD ( const std::wstring &  cfgFile,
const std::map< std::wstring, E > &  esc = std::map<std::wstring,E>() 
) [inline]

Constructor, load data from config file.

template<class G, class E>
freeling::smoothingLD< G, E >::~smoothingLD ( ) [inline]

destructor


Member Function Documentation

template<class G, class E>
double freeling::smoothingLD< G, E >::count ( const G &  ngram) const [inline, private]
template<class G, class E>
double freeling::smoothingLD< G, E >::Prob ( const G &  ngram,
const E &  z 
) const [inline]

Compute smoothed conditional log prob of seeing symbol z following given ngram P(z|ngram)

Referenced by freeling::smoothingLD< std::wstring, wchar_t >::Prob().


Member Data Documentation

template<class G, class E>
double freeling::smoothingLD< G, E >::alpha [private]
template<class G, class E>
std::map<G,double> freeling::smoothingLD< G, E >::counts [private]
template<class G, class E>
std::map<std::wstring,E> freeling::smoothingLD< G, E >::escapes [private]

translation table for escaped symbols in input (e.g. ,
, ...)

Referenced by freeling::smoothingLD< std::wstring, wchar_t >::smoothingLD().

template<class G, class E>
double freeling::smoothingLD< G, E >::nobs [private]
template<class G, class E>
double freeling::smoothingLD< G, E >::notalpha [private]
template<class G, class E>
size_t freeling::smoothingLD< G, E >::order [private]

order of the n-gram model. Order=3 => trigram model P(z|xy)

Referenced by freeling::smoothingLD< std::wstring, wchar_t >::smoothingLD().

template<class G, class E>
double freeling::smoothingLD< G, E >::pUnseen [private]

The documentation for this class was generated from the following file: