Public Member Functions | Public Attributes | List of all members
moot::mootDynLexHMM_Boltzmann Class Reference

mootDynHMM subclass using a Maxwell-Boltzmann distribution to estimate f(w,t) More...

Inheritance diagram for moot::mootDynLexHMM_Boltzmann:
Inheritance graph
[legend]
Collaboration diagram for moot::mootDynLexHMM_Boltzmann:
Collaboration graph
[legend]

Public Member Functions

 mootDynLexHMM_Boltzmann (void)
 
virtual void set_options (const mootDynHMMOptions &opts)
 
virtual ProbT dynlex_analysis_freq (const mootToken &tok, const mootToken::Analysis &a)
 
virtual void tw_put_info (moot::TokenWriter *tw)
 
- Public Member Functions inherited from moot::mootDynLexHMM
 mootDynLexHMM (void)
 
virtual ~mootDynLexHMM (void)
 
virtual bool load_model (const string &modelname, const mootTagString &start_tag_str="__$", const char *myname="mootDynLexHMM::load_model()", bool do_estimate_nglambdas=true, bool do_estimate_wlambdas=true, bool do_estimate_clambdas=true, bool do_build_suffix_trie=true, bool do_compute_logprobs=true)
 
virtual bool compile (mootLexfreqs &lexfreqs, mootNgrams &ngrams, mootClassfreqs &classfreqs, const mootTagString &start_tag_str="__$")
 
virtual void tag_hook_pre (mootSentence &sent)
 
virtual void tag_hook_post (mootSentence &sent)
 
void dynlex_clear (void)
 
virtual void dynlex_populate_lexprobs (void)
 
- Public Member Functions inherited from moot::mootDynHMM
 mootDynHMM (void)
 
virtual ~mootDynHMM (void)
 
void lex_clear (void)
 
void lex_resize (TokID tokid_max)
 
TokID lex_get_tokid (const mootTokString &tok_text)
 
void tagset_resize (TagID tagid_max)
 
TagID get_tagid (const mootTagString &tagstr)
 
virtual void tag_io (TokenReader *reader, TokenWriter *writer)
 
virtual void tag_sentence (mootSentence &sentence)
 
- Public Member Functions inherited from moot::mootHMM
 mootHMM (void)
 
virtual ~mootHMM (void)
 
void clear (bool wipe_everything=true, bool unlogify=false)
 
bool save (const char *filename, int compression_level=(-1))
 
bool save (mootio::mostream *obs, const char *filename=__null)
 
bool _bindump (mootio::mostream *obs, const mootBinIO::HeaderInfo &hdr, const char *filename=__null)
 
bool load (const char *filename=__null)
 
bool load (mootio::mistream *ibs, const char *filename=__null)
 
bool _binload (mootio::mistream *ibs, const mootBinIO::HeaderInfo &hdr, const char *filename=__null)
 
void unknown_token_name (const mootTokString &name)
 
void unknown_tag_name (const mootTokString &name)
 
void unknown_class_name (const mootTagSet &tagset)
 
virtual bool compile (const mootLexfreqs &lexfreqs, const mootNgrams &ngrams, const mootClassfreqs &classfreqs, const mootTagString &start_tag_str="__$", const mootTaster &mtaster=builtinTaster)
 
void assign_ids_fl (void)
 
void assign_ids_lf (const mootLexfreqs &lexfreqs)
 
void assign_ids_ng (const mootNgrams &ngrams)
 
void assign_ids_cf (const mootClassfreqs &classfreqs)
 
void compile_unknown_lexclass (const mootClassfreqs &classfreqs)
 
bool estimate_lambdas (const mootNgrams &ngrams)
 
bool estimate_wlambdas (const mootLexfreqs &lf)
 
bool estimate_clambdas (const mootClassfreqs &cf)
 
bool build_suffix_trie (const mootLexfreqs &lf, const mootNgrams &ng, bool verbose=false)
 
bool compute_logprobs (void)
 
void set_ngram_prob (ProbT p, TagID t1=0, TagID t2=0, TagID t3=0)
 
void tag_sentence (mootSentence &sentence)
 
virtual void tag_stream (TokenReader *reader, TokenWriter *writer)
 
void viterbi_clear (void)
 
void viterbi_step (const mootToken &token)
 
void viterbi_step (TokID tokid, const LexClass &lexclass, const mootTokString &toktext="")
 
void viterbi_step (TokID tokid, ClassID classid, const LexClass &lclass, const mootTokString &toktext="")
 
void viterbi_step (TokID tokid, const mootTokString &toktext="")
 
void viterbi_step (const mootTokString &token_text)
 
void viterbi_step (const mootTokString &token_text, const set< mootTagString > &tags)
 
void viterbi_step (TokID tokid, TagID tagid, ViterbiColumn *col=__null)
 
void viterbi_step (const mootTokString &toktext, const mootTagString &tag)
 
void viterbi_finish (const TagID final_tagid)
 
void viterbi_finish (void)
 
void viterbi_flush (TokenWriter *writer, mootSentence &toks, ViterbiNode *nod)
 
void tag_mark_best (mootSentence &sentence)
 
void tag_mark_best (ViterbiPathNode *pnod, mootSentence &sentence)
 
void tag_dump_trace (mootSentence &sentence, bool dumpPredict=false)
 
ViterbiPathNodeviterbi_best_path (void)
 
ViterbiPathNodeviterbi_best_path (TagID tagid)
 
ViterbiPathNodeviterbi_best_path (const mootTagString &tagstr)
 
ViterbiNodeviterbi_best_node (void)
 
ViterbiNodeviterbi_best_node (TagID tagid)
 
ViterbiNodeviterbi_flushable_node (void)
 
ViterbiPathNodeviterbi_node_path (ViterbiNode *node)
 
bool viterbi_column_ok (const ViterbiColumn *col) const
 
ViterbiColumnviterbi_populate_row (TagID curtagid, ProbT wordpr=0.0, ViterbiColumn *col=__null, ProbT probmin=1.0)
 
void viterbi_clear_bestpath (void)
 
void _viterbi_step_fallback (TokID tokid, ViterbiColumn *col)
 
ViterbiNodeviterbi_get_node (void)
 
ViterbiRowviterbi_get_row (void)
 
ViterbiColumnviterbi_get_column (void)
 
ViterbiPathNodeviterbi_get_pathnode (void)
 
TokID token2id (const mootTokString &token) const
 
void token2lexclass (const mootToken &token, LexClass &tok_class) const
 
LexClasstagset2lexclass (const mootTagSet &tagset, LexClass *lclass=__null, bool add_tagids=false)
 
ClassID class2id (const LexClass &lclass, bool autopopulate=true, bool autocreate=true)
 
const ProbT wordp (const TokID tokid, const TagID tagid) const
 
const ProbT wordp (const mootTokString &tokstr, const mootTagString &tagstr) const
 
const ProbT classp (const ClassID classid, const TagID tagid) const
 
const ProbT classp (const LexClass &lclass, const mootTagString &tagstr) const
 
const ProbT tagp (const TagID tagid) const
 
const ProbT tagp (const mootTagString &tag) const
 
const ProbT tagp (const TagID prevtagid, const TagID tagid) const
 
const ProbT tagp (const mootTagString &prevtag, const mootTagString &tag) const
 
const ProbT tagp (const Trigram &trigram, ProbT ProbZero=-1E+38) const
 
const ProbT tagp (const TagID prevtagid2, const TagID prevtagid1, const TagID tagid) const
 
const ProbT tagp (const mootTagString &prevtag2, const mootTagString &prevtag1, const mootTagString &tag) const
 
void carp (const char *fmt,...)
 
void txtdump (FILE *file, bool dump_constants=true, bool dump_lexprobs=true, bool dump_classprobs=true, bool dump_suftrie=true, bool dump_ngprobs=true)
 
void viterbi_txtdump (TokenWriter *w, int ncols=0)
 
void viterbi_txtdump_col (TokenWriter *w, ViterbiColumn *col, int colnum=0)
 

Public Attributes

ProbT dynlex_base
 
ProbT dynlex_beta
 
- Public Attributes inherited from moot::mootDynLexHMM
bool invert_lexp
 
TagStr newtag_str
 
TagID newtag_id
 
ProbT newtag_f
 
TagTokProbMap Ftw
 
TokProbMap Fw
 
TokProbMap Ft
 
ProbT Ftw_eps
 
size_t tagids_size_orig
 
- Public Attributes inherited from moot::mootHMM
int verbose
 
size_t ndots
 
bool save_ambiguities
 
bool save_flavors
 
bool save_mark_unknown
 
bool hash_ngrams
 
bool relax
 
bool use_lex_classes
 
bool use_flavors
 
TagID start_tagid
 
ProbT unknown_lex_threshhold
 
ProbT unknown_class_threshhold
 
LexClass uclass
 
ProbT nglambda1
 
ProbT nglambda2
 
ProbT nglambda3
 
ProbT wlambda0
 
ProbT wlambda1
 
ProbT clambda0
 
ProbT clambda1
 
ProbT beamwd
 
TokIDTable tokids
 
TagIDTable tagids
 
ClassIDTable classids
 
mootTaster taster
 
size_t n_tags
 
size_t n_toks
 
size_t n_classes
 
LexProbTable lexprobs
 
LexClassProbTable lcprobs
 
NgramProbHash ngprobsh
 
NgramProbArray ngprobsa
 
SuffixTrie suftrie
 
ViterbiColumnvtable
 
size_t nsents
 
size_t ntokens
 
size_t nnewtokens
 
size_t nunclassed
 
size_t nnewclasses
 
size_t nunknown
 
size_t nfallbacks
 

Additional Inherited Members

- Public Types inherited from moot::mootDynLexHMM
typedef mootTokString TokStr
 
typedef mootTagString TagStr
 
typedef std::map< TokStr, ProbTTokProbMap
 
typedef std::map< TagStr, ProbTTagProbMap
 
typedef std::map< TagStr, TokProbMapTagTokProbMap
 
typedef std::map< TagStr, TagProbMapTokTagProbMap
 
- Public Types inherited from moot::mootHMM
typedef mootEnumID TagID
 
typedef mootEnumID TokID
 
typedef mootEnumID FlavorID
 
typedef mootEnumID ClassID
 
typedef moot::VerbosityLevel VerbosityLevel
 
typedef set< TagIDLexClass
 
typedef mootEnum< mootTagString, __gnu_cxx::hash< mootTagString >, equal_to< mootTagString > > TagIDTable
 
typedef mootEnum< mootTokString, __gnu_cxx::hash< mootTokString >, equal_to< mootTokString > > TokIDTable
 
typedef mootEnum< LexClass, LexClassHash, LexClassEqualClassIDTable
 
typedef AssocVector< TagID, ProbTLexProbSubTable
 
typedef LexProbSubTable LexClassProbSubTable
 
typedef vector< LexProbSubTableLexProbTable
 
typedef LexProbTable LexClassProbTable
 
typedef ProbTUnigramProbTable
 
typedef hash_map< Trigram, ProbT, Trigram::HashFcn, Trigram::EqualFcnTrigramProbHash
 
typedef ProbTTrigramProbArray
 Type for uni-, bi- and trigram probability lookup table. More...
 
typedef Trigram NgramProbKey
 Generic n-gram key: trigrams. More...
 
typedef TrigramProbHash NgramProbHash
 Generic n-gram probabilities: trigrams, hashed. More...
 
typedef TrigramProbArray NgramProbArray
 Generic n-gram probabilities: trigrams, dense. More...
 
- Protected Attributes inherited from moot::mootHMM
ViterbiNodetrash_nodes
 
ViterbiRowtrash_rows
 
ViterbiColumntrash_columns
 
ViterbiPathNodetrash_pathnodes
 
TagID vtagid
 
ProbT vbestpr
 
ProbT vtagpr
 
ProbT vwordpr
 
ViterbiNodevbestpn
 
ViterbiPathNodevbestpath
 

Detailed Description

Estimates f(w,t) = dynlex_base^(-dynlex_beta * a.prob) for token text w and analysis a with tag t.

This estimator is suitable for use with token analyses whose prob field contains non-negative "costs" or "distances" associated with the token-tag pair.

Constructor & Destructor Documentation

◆ mootDynLexHMM_Boltzmann()

moot::mootDynLexHMM_Boltzmann::mootDynLexHMM_Boltzmann ( void  )
inline

Constructor

Member Function Documentation

◆ set_options()

virtual void moot::mootDynLexHMM_Boltzmann::set_options ( const mootDynHMMOptions opts)
inlinevirtual

◆ dynlex_analysis_freq()

virtual ProbT moot::mootDynLexHMM_Boltzmann::dynlex_analysis_freq ( const mootToken tok,
const mootToken::Analysis a 
)
inlinevirtual

Estimate pseudo-frequency for the tag associated with analysis a of token tok. This implementation returns f(w,t) = Ftw_eps + dynlex_base^(-dynlex_beta * a.prob)

Reimplemented from moot::mootDynLexHMM.

References moot::mootDynHMMOptions::Ftw_eps, and moot::mootToken::Analysis::prob.

◆ tw_put_info()

virtual void moot::mootDynLexHMM_Boltzmann::tw_put_info ( moot::TokenWriter tw)
inlinevirtual

User-level information

Reimplemented from moot::mootDynLexHMM.

References moot::TokenWriter::printf_raw(), and moot::mootDynLexHMM::tw_put_info().

Member Data Documentation

◆ dynlex_base

ProbT moot::mootDynLexHMM_Boltzmann::dynlex_base

Base of Maxwell-Boltzmann estimator (>1), default=2. A value of 1.0 gives a uniform output distribution. Greater values give lower-entropy output distributions.

◆ dynlex_beta

ProbT moot::mootDynLexHMM_Boltzmann::dynlex_beta

"Temperature" coefficient of Maxwell-Boltzmann estimator (>0), default=1 A value of 0.0 gives a uniform output distribution. Greater values give lower-entropy output distributions.


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