The class hmm_tagger implements the syntactic analyzer and is the main class, which uses all the others. More...
#include <hmm_tagger.h>
Public Member Functions | |
hmm_tagger (const std::string &, const std::string &, bool, unsigned int) | |
Constructor. | |
void | analyze (std::list< sentence > &) |
analyze given sentences | |
std::list< sentence > | analyze (const std::list< sentence > &) |
analyze sentences and return analyzed copy (for java API) | |
Private Member Functions | |
bool | is_forbidden (const std::string &, sentence::const_iterator) const |
double | ProbA_log (const std::string &, const std::string &, sentence::const_iterator) const |
Compute transition log_probability from state_i to state_j, returning appropriate smoothed values if no evidence is available. | |
double | ProbB_log (const std::string &, const word &) const |
Compute emission log_probability for observation obs from state_i. | |
double | ProbPi_log (const std::string &) const |
Compute initial log_probability for state_i. | |
std::list< emission_states > | FindStates (const sentence &) const |
compute possible emission states for each word in sentence. | |
Private Attributes | |
std::string | Language |
std::map< std::string, double > | PTag |
maps to store the probabilities | |
std::map< std::string, double > | PBg |
std::map< std::string, double > | PTrg |
std::map< std::string, double > | PInitial |
std::map< std::string, double > | PWord |
std::multimap< std::string, std::string > | Forbidden |
set of hand-specified forbidden bigram and trigram transitions | |
float | ZERO_logprob |
log prob for zero | |
double | c [3] |
coeficients to compute linear interpolation |
The class hmm_tagger implements the syntactic analyzer and is the main class, which uses all the others.
hmm_tagger::hmm_tagger | ( | const std::string & | lang, | |
const std::string & | HMM_File, | |||
bool | rtk, | |||
unsigned int | force | |||
) |
std::list< sentence > hmm_tagger::analyze | ( | const std::list< sentence > & | ls | ) |
analyze sentences and return analyzed copy (for java API)
Disambiguate given sentences, return analyzed copy.
References analyze().
void hmm_tagger::analyze | ( | std::list< sentence > & | ls | ) | [virtual] |
analyze given sentences
Disambiguate given sentences with provided options.
Implements POS_tagger.
References aux, FindStates(), POS_tagger::force, FORCE_RETOK, POS_tagger::force_select(), FORCE_TAGGER, Language, ProbA_log(), ProbB_log(), ProbPi_log(), POS_tagger::retok, POS_tagger::retokenize(), TRACE, and ZERO_logprob.
Referenced by analyze().
list< emission_states > hmm_tagger::FindStates | ( | const sentence & | sent | ) | const [private] |
bool hmm_tagger::is_forbidden | ( | const std::string & | , | |
sentence::const_iterator | ||||
) | const [private] |
Referenced by ProbA_log().
double hmm_tagger::ProbA_log | ( | const std::string & | state_i, | |
const std::string & | state_j, | |||
sentence::const_iterator | w | |||
) | const [private] |
double hmm_tagger::ProbB_log | ( | const std::string & | state_i, | |
const word & | obs | |||
) | const [private] |
double hmm_tagger::ProbPi_log | ( | const std::string & | state_i | ) | const [private] |
Compute initial log_probability for state_i.
References PInitial, and ZERO_logprob.
Referenced by analyze().
double hmm_tagger::c[3] [private] |
coeficients to compute linear interpolation
Referenced by hmm_tagger(), and ProbA_log().
std::multimap<std::string, std::string> hmm_tagger::Forbidden [private] |
set of hand-specified forbidden bigram and trigram transitions
Referenced by hmm_tagger().
std::string hmm_tagger::Language [private] |
Referenced by analyze(), FindStates(), and hmm_tagger().
std::map<std::string, double> hmm_tagger::PBg [private] |
Referenced by hmm_tagger(), and ProbA_log().
std::map<std::string, double> hmm_tagger::PInitial [private] |
Referenced by hmm_tagger(), and ProbPi_log().
std::map<std::string, double> hmm_tagger::PTag [private] |
maps to store the probabilities
Referenced by hmm_tagger(), and ProbA_log().
std::map<std::string, double> hmm_tagger::PTrg [private] |
Referenced by hmm_tagger(), and ProbA_log().
std::map<std::string, double> hmm_tagger::PWord [private] |
Referenced by hmm_tagger(), and ProbB_log().
float hmm_tagger::ZERO_logprob [private] |
log prob for zero
Referenced by analyze(), hmm_tagger(), and ProbPi_log().