|
FreeLing
4.0
|
Class smoothingLD computes linear-discount smoothed conditional probabilities P(z|w1...wn) for n-gram transitions. More...
#include <smoothingLD.h>

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. , , ...) | |
Class smoothingLD computes linear-discount smoothed conditional probabilities P(z|w1...wn) for n-gram transitions.
template parameters:
| 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.
| freeling::smoothingLD< G, E >::~smoothingLD | ( | ) | [inline] |
destructor
| double freeling::smoothingLD< G, E >::count | ( | const G & | ngram | ) | const [inline, private] |
Referenced by freeling::smoothingLD< std::wstring, wchar_t >::Prob().
| 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().
double freeling::smoothingLD< G, E >::alpha [private] |
log alpha and 1-alpha parameter for linear discount
Referenced by freeling::smoothingLD< std::wstring, wchar_t >::Prob(), and freeling::smoothingLD< std::wstring, wchar_t >::smoothingLD().
std::map<G,double> freeling::smoothingLD< G, E >::counts [private] |
map to store ngram counts (for any size of ngram)
Referenced by freeling::smoothingLD< std::wstring, wchar_t >::count(), and freeling::smoothingLD< std::wstring, wchar_t >::smoothingLD().
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().
double freeling::smoothingLD< G, E >::nobs [private] |
double freeling::smoothingLD< G, E >::notalpha [private] |
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().
double freeling::smoothingLD< G, E >::pUnseen [private] |
1.7.6.1