Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members

PLearn::GraphicalBiText Class Reference

#include <GraphicalBiText.h>

Inheritance diagram for PLearn::GraphicalBiText:

Inheritance graph
[legend]
Collaboration diagram for PLearn::GraphicalBiText:

Collaboration graph
[legend]
List of all members.

Public Types

typedef Learner inherited

Public Member Functions

 GraphicalBiText ()
virtual ~GraphicalBiText ()
 PLEARN_DECLARE_OBJECT (GraphicalBiText)
void build ()
 **** SUBCLASS WRITING: **** This method should be redefined in subclasses, to just call inherited::build() and then build_()

void use (const Vec &input, Vec &output)
void train (VMat training_set)
void test ()
void train (int n_epoch)
void senseTagBitext (string name)
void check_consitency ()
void print (string name)
void printHierarchy (string name)
void update_WSD_model (string name)
void sensetag_valid_bitext (string name)
void computeKL ()
void loadSensemap (string sensemap_file)
void compute_train_likelihood (string name)
void compute_valid_likelihood (string name)
void test_WSD (VMat wsd_test, string name, TVec< string > v, bool select, real interp=DEF_INTERP)
void setTrainingSet (VMat training_set, bool call_forget)

Static Public Member Functions

void declareOptions (OptionList &ol)
 redefine this in subclasses: call declareOption(...) for each option, and then call inherited::declareOptions(options) ( see the declareOption function further down)


Public Attributes

int window_size
int n_train_examples
int n_test_examples
int n_epoch
string source_path
string source_voc
string target_voc
string train_file
string valid_file
string key_file
string sensemap_file
int sensemap_level
string semcor_train_path
string semcor_valid_path
string semcor_valid2_path
string semcor_test_path
string senseval2_train_path
VMat wsd_train
VMat wsd_valid
VMat wsd_valid2
VMat wsd_test
VMat senseval2_train
real update_threshold
string output_dir

Private Member Functions

void compute_likelihood (Vec bitext_src, Vec bitext_tgt, string name, bool update)
int getDeepestCommonAncestor (int s1, int s2)
void compute_pTC ()
void compute_pTC (int word)
void distribute_pS_on_ancestors (int s, real probaToDistribute)
void compute_node_level ()
void compute_pMC ()
void check_set_pA ()
void printNode (int ss, ostream &out_hie)
void update_pWS (ProbSparseMatrix &, int, string)
real compute_efs_likelihood (int e, int f, int se)
real compute_BN_likelihood (int e, int f, bool update, real nb)
void optimize_interp_parameter (Vec tgt, Vec src, string name)
void loadBitext (string train_file_name, string valid_file_name, bool update_voc)
void compute_nodemap (int split_level)
void set_nodemap (int node, int word)
void print_sensemap ()
void build_ ()
void init_WSD ()
void init ()

Private Attributes

ProbVector pS
ProbVector pMC
Vec pC
Vec pTC
Vec pA
Vec nA
ProbSparseMatrix nFS
ProbSparseMatrix pFS
ProbSparseMatrix nES
ProbSparseMatrix pES
TMat< SetcommNode
map< int, Setsens_to_conceptAncestors
map< int, Settarget_word_to_senses
ProbVector pF
ProbVector pE
ProbSparseMatrix nEF
ProbSparseMatrix pEF
ProbSparseMatrix nSE
ProbSparseMatrix pSE
ProbSparseMatrix nSEbi
ProbSparseMatrix pSEbi
Vec KL
map< int, boolBiSelect
map< string, stringsensemap
map< int, intnodemap
map< int, intnode_level
int n_fields
ProbVector pEbase
ProbVector pSbase
ProbVector pSupbi
Vec nS
ProbVector pH
ProbVector pHbase
ProbVector pHupbi
ProbSparseMatrix nESbase
ProbSparseMatrix nESupbi
SmoothedProbSparseMatrix pESbase
SmoothedProbSparseMatrix pESupbi
ProbSparseMatrix nHS
SmoothedProbSparseMatrix pHS
ProbSparseMatrix nHSupbi
SmoothedProbSparseMatrix pHSupbi
WordNetOntology ontology
int source_wsd_voc_size
int sense_size
int ss_size
map< int, stringsource_id_to_word
map< string, intsource_word_to_id
int source_voc_size
map< int, stringtarget_id_to_word
map< string, inttarget_word_to_id
map< int, realtarget_id_to_proba
int target_voc_size
Set target_wsd_voc
int target_wsd_voc_size
Vec train_bitext_tgt
Vec train_bitext_src
Vec valid_bitext_tgt
Vec valid_bitext_src
real alpha_bn
real alpha_joint
Vec sum_epEC
Vec sum_fpFC
Vec sum_cpC

Member Typedef Documentation

typedef Learner PLearn::GraphicalBiText::inherited
 

Reimplemented from PLearn::Learner.

Definition at line 208 of file GraphicalBiText.h.


Constructor & Destructor Documentation

PLearn::GraphicalBiText::GraphicalBiText  ) 
 

Definition at line 10 of file GraphicalBiText.cc.

References PLearn::sample().

PLearn::GraphicalBiText::~GraphicalBiText  )  [virtual]
 

Definition at line 26 of file GraphicalBiText.cc.


Member Function Documentation

void PLearn::GraphicalBiText::build  )  [virtual]
 

**** SUBCLASS WRITING: **** This method should be redefined in subclasses, to just call inherited::build() and then build_()

Reimplemented from PLearn::Learner.

Definition at line 66 of file GraphicalBiText.cc.

References build_().

void PLearn::GraphicalBiText::build_  )  [private]
 

**** SUBCLASS WRITING: **** The build_ and build methods should be redefined in subclasses build_ should do the actual building of the Learner according to build options (member variables) previously set. (These may have been set by hand, by a constructor, by the load method, or by setOption) As build() may be called several times (after changing options, to "rebuild" an object with different build options), make sure your implementation can handle this properly.

Reimplemented from PLearn::Learner.

Definition at line 73 of file GraphicalBiText.cc.

References alpha_bn, alpha_joint, PLearn::Set::begin(), BiSelect, COLUMN_WISE, commNode, PLearn::Set::end(), PLearn::endl(), PLearn::WordNetOntology::fillTempWordToSensesTVecMap(), PLearn::Set::find(), PLearn::WordNetOntology::getAllWords(), PLearn::WordNetOntology::getMaxSynsetId(), PLearn::WordNetOntology::getSenseSize(), PLearn::WordNetOntology::getVocSize(), PLearn::WordNetOntology::getWord(), PLearn::WordNetOntology::getWordId(), init(), INIT_ALPHA, init_WSD(), PLearn::Set::insert(), KL, loadBitext(), nA, nEF, nES, nESbase, nESupbi, nFS, nHS, nHSupbi, nS, nSE, nSEbi, ontology, OOV_TAG, pA, pC, pE, pEbase, pEF, pES, pESbase, pESupbi, pF, pFS, pH, pHbase, pHS, pHSupbi, pHupbi, PLERROR, PLWARNING, pMC, pS, pSbase, pSE, pSEbi, pSupbi, pTC, PLearn::WordNetOntology::removeNonReachableSynsets(), PLearn::WordNetOntology::removeWord(), PLearn::DoubleAccessSparseMatrix< real >::resize(), PLearn::TVec< T >::resize(), PLearn::TMat< Set >::resize(), sense_size, PLearn::SetIterator, PLearn::DoubleAccessSparseMatrix< real >::setMode(), PLearn::DoubleAccessSparseMatrix< real >::setName(), PLearn::Set::size(), source_id_to_word, source_path, source_voc, source_voc_size, source_word_to_id, source_wsd_voc_size, PLearn::split(), ss_size, sum_cpC, sum_epEC, sum_fpFC, target_id_to_word, target_voc, target_voc_size, target_word_to_id, target_wsd_voc, target_wsd_voc_size, PLearn::tostring(), train_file, and valid_file.

Referenced by build().

void PLearn::GraphicalBiText::check_consitency  ) 
 

Definition at line 1237 of file GraphicalBiText.cc.

References PLearn::SmoothedProbSparseMatrix::checkCondProbIntegrity(), PLearn::ProbSparseMatrix::checkCondProbIntegrity(), PLearn::endl(), pA, pC, pE, pEF, pES, pF, pFS, pH, pHS, pHSupbi, pHupbi, pMC, pS, pSbase, pTC, PLearn::sum(), and PLearn::DoubleAccessSparseMatrix< real >::sumOfElements().

Referenced by init(), and train().

void PLearn::GraphicalBiText::check_set_pA  )  [private]
 

Definition at line 1189 of file GraphicalBiText.cc.

References PLearn::Set::begin(), PLearn::Node::children, PLearn::Set::end(), PLearn::WordNetOntology::getAllCategories(), PLearn::WordNetOntology::getSynset(), ontology, pA, PLearn::Node::parents, pS, pTC, PLearn::SetIterator, and PLearn::Set::size().

Referenced by compute_likelihood(), and init().

real PLearn::GraphicalBiText::compute_BN_likelihood int  e,
int  f,
bool  update,
real  nb
[private]
 

Definition at line 1934 of file GraphicalBiText.cc.

References PLearn::Set::begin(), PLearn::Set::clear(), commNode, PLearn::Set::end(), PLearn::Set::find(), PLearn::DoubleAccessSparseMatrix< real >::get(), PLearn::WordNetOntology::getAllCategories(), PLearn::WordNetOntology::getSynsetAncestors(), PLearn::WordNetOntology::getWordSenses(), PLearn::ProbSparseMatrix::incr(), PLearn::Set::insert(), nA, nES, nFS, nS, nSEbi, ontology, pA, pC, pES, pFS, PLERROR, PROB_PREC, pS, pTC, PLearn::TVec< T >::resize(), PLearn::SetIterator, ss_size, sum_epEC, sum_fpFC, target_word_to_senses, and PLearn::update().

Referenced by compute_likelihood(), and print().

real PLearn::GraphicalBiText::compute_efs_likelihood int  e,
int  f,
int  se
[private]
 

Definition at line 1557 of file GraphicalBiText.cc.

References PLearn::Set::begin(), commNode, PLearn::Set::end(), PLearn::Set::find(), PLearn::DoubleAccessSparseMatrix< real >::get(), PLearn::WordNetOntology::getAllCategories(), PLearn::WordNetOntology::getSynsetAncestors(), PLearn::Set::insert(), ontology, pC, pES, pFS, PLERROR, pS, pTC, PLearn::TVec< T >::resize(), PLearn::SetIterator, ss_size, and target_word_to_senses.

Referenced by print(), sensetag_valid_bitext(), senseTagBitext(), and update_WSD_model().

void PLearn::GraphicalBiText::compute_likelihood Vec  bitext_src,
Vec  bitext_tgt,
string  name,
bool  update
[private]
 

Definition at line 2149 of file GraphicalBiText.cc.

References alpha_bn, alpha_joint, PLearn::Set::begin(), c_str(), check_set_pA(), PLearn::DoubleAccessSparseMatrix< real >::clear(), PLearn::TVec< T >::clear(), COLUMN_WISE, compute_BN_likelihood(), compute_pMC(), compute_pTC(), PLearn::ShellProgressBar::done(), PLearn::ShellProgressBar::draw(), PLearn::Set::end(), PLearn::endl(), PLearn::Set::find(), PLearn::DoubleAccessSparseMatrix< real >::get(), PLearn::WordNetOntology::getAllCategories(), PLearn::WordNetOntology::getAllWords(), PLearn::DoubleAccessSparseMatrix< real >::getCol(), PLearn::DoubleAccessSparseMatrix< real >::getWidth(), PLearn::ProbSparseMatrix::incr(), PLearn::ShellProgressBar::init(), PLearn::WordNetOntology::isWord(), PLearn::log(), nA, nES, nFS, PLearn::ProbSparseMatrix::normalizeCond(), nS, nSEbi, ontology, pA, pE, pEF, pES, pF, pFS, PLERROR, PROB_PREC, pS, pSEbi, PLearn::DoubleAccessSparseMatrix< real >::resize(), PLearn::safeexp(), PLearn::ProbSparseMatrix::set(), PLearn::ShellProgressBar::set(), PLearn::SetIterator, PLearn::DoubleAccessSparseMatrix< real >::setMode(), PLearn::DoubleAccessSparseMatrix< real >::setName(), PLearn::TVec< T >::size(), source_id_to_word, source_wsd_voc_size, ss_size, PLearn::sum(), target_id_to_word, target_wsd_voc, target_wsd_voc_size, PLearn::ShellProgressBar::update(), and PLearn::update().

Referenced by compute_train_likelihood(), and compute_valid_likelihood().

void PLearn::GraphicalBiText::compute_node_level  )  [private]
 

Definition at line 908 of file GraphicalBiText.cc.

References PLearn::Set::begin(), PLearn::Node::children, PLearn::Set::clear(), PLearn::Set::end(), PLearn::WordNetOntology::getSynset(), PLearn::WordNetOntology::isSynset(), node_level, ontology, PLWARNING, pMC, pTC, ROOT_SS_ID, and PLearn::SetIterator.

Referenced by init().

void PLearn::GraphicalBiText::compute_nodemap int  split_level  )  [private]
 

Definition at line 1098 of file GraphicalBiText.cc.

References PLearn::Set::begin(), PLearn::Node::children, PLearn::Set::clear(), compute_pTC(), PLearn::Set::end(), PLearn::endl(), PLearn::WordNetOntology::extractAncestors(), PLearn::Set::find(), PLearn::WordNetOntology::getAllWords(), PLearn::WordNetOntology::getSenseKey(), PLearn::WordNetOntology::getSynset(), PLearn::WordNetOntology::getWordSenses(), PLearn::WordNetOntology::isSynset(), nodemap, ontology, pSE, pTC, ROOT_SS_ID, sensemap, set_nodemap(), and PLearn::SetIterator.

Referenced by init().

void PLearn::GraphicalBiText::compute_pMC  )  [private]
 

Definition at line 960 of file GraphicalBiText.cc.

References PLearn::Set::begin(), PLearn::Node::children, PLearn::Set::clear(), PLearn::TVec< T >::clear(), PLearn::Set::end(), PLearn::WordNetOntology::getSynset(), PLearn::WordNetOntology::isSynset(), ontology, pA, pC, PLWARNING, pMC, PLearn::WordNetOntology::printSynset(), pTC, ROOT_SS_ID, and PLearn::SetIterator.

Referenced by compute_likelihood(), and init().

void PLearn::GraphicalBiText::compute_pTC int  word  )  [private]
 

Definition at line 838 of file GraphicalBiText.cc.

References PLearn::Set::begin(), PLearn::TVec< T >::clear(), distribute_pS_on_ancestors(), PLearn::Set::end(), PLearn::Set::find(), PLearn::WordNetOntology::getAllCategories(), PLearn::WordNetOntology::getWordSenses(), PLearn::WordNetOntology::isPureCategory(), PLearn::WordNetOntology::isPureSense(), ontology, pS, pTC, and PLearn::SetIterator.

void PLearn::GraphicalBiText::compute_pTC  )  [private]
 

Definition at line 814 of file GraphicalBiText.cc.

References PLearn::Set::begin(), PLearn::TVec< T >::clear(), distribute_pS_on_ancestors(), PLearn::Set::end(), PLearn::WordNetOntology::getAllCategories(), PLearn::WordNetOntology::isPureCategory(), PLearn::WordNetOntology::isPureSense(), ontology, pS, pTC, and PLearn::SetIterator.

Referenced by compute_likelihood(), compute_nodemap(), and init().

void PLearn::GraphicalBiText::compute_train_likelihood string  name  ) 
 

Definition at line 2139 of file GraphicalBiText.cc.

References compute_likelihood(), train_bitext_src, and train_bitext_tgt.

Referenced by train().

void PLearn::GraphicalBiText::compute_valid_likelihood string  name  ) 
 

Definition at line 2144 of file GraphicalBiText.cc.

References compute_likelihood(), valid_bitext_src, and valid_bitext_tgt.

Referenced by train().

void PLearn::GraphicalBiText::computeKL  ) 
 

Definition at line 2331 of file GraphicalBiText.cc.

References PLearn::Set::begin(), PLearn::Set::end(), PLearn::DoubleAccessSparseMatrix< real >::get(), PLearn::WordNetOntology::getAllWords(), PLearn::DoubleAccessSparseMatrix< real >::getCol(), KL, ontology, pSE, pSEbi, PLearn::safeflog2(), PLearn::SetIterator, and PLearn::DoubleAccessSparseMatrix< real >::sumCol().

void PLearn::GraphicalBiText::declareOptions OptionList ol  )  [static]
 

redefine this in subclasses: call declareOption(...) for each option, and then call inherited::declareOptions(options) ( see the declareOption function further down)

ex: static void declareOptions(OptionList& ol) { declareOption(ol, "inputsize", &MyObject::inputsize_, OptionBase::buildoption, "the size of the input\n it must be provided"); declareOption(ol, "weights", &MyObject::weights, OptionBase::learntoption, "the learnt model weights"); inherited::declareOptions(ol); }

Reimplemented from PLearn::Learner.

Definition at line 31 of file GraphicalBiText.cc.

References PLearn::declareOption(), and PLearn::OptionList.

void PLearn::GraphicalBiText::distribute_pS_on_ancestors int  s,
real  probaToDistribute
[private]
 

Definition at line 863 of file GraphicalBiText.cc.

References PLearn::Set::begin(), distribute_pS_on_ancestors(), PLearn::Set::end(), PLearn::WordNetOntology::getSynsetParents(), ontology, pTC, PLearn::SetIterator, and PLearn::Set::size().

Referenced by compute_pTC(), and distribute_pS_on_ancestors().

int PLearn::GraphicalBiText::getDeepestCommonAncestor int  s1,
int  s2
[private]
 

Definition at line 766 of file GraphicalBiText.cc.

References PLearn::Set::begin(), PLearn::Set::end(), PLearn::Set::find(), PLearn::WordNetOntology::getSynset(), PLearn::WordNetOntology::getSynsetAncestors(), PLearn::Set::insert(), ontology, PLearn::Node::parents, PLERROR, pTC, and PLearn::SetIterator.

Referenced by init().

void PLearn::GraphicalBiText::init  )  [private]
 

Definition at line 486 of file GraphicalBiText.cc.

References PLearn::argmax(), PLearn::TVec< T >::begin(), PLearn::Set::begin(), check_consitency(), check_set_pA(), PLearn::TVec< T >::clear(), PLearn::DoubleAccessSparseMatrix< real >::clear(), commNode, compute_node_level(), compute_nodemap(), compute_pMC(), compute_pTC(), PLearn::ShellProgressBar::done(), PLearn::ShellProgressBar::draw(), PLearn::Set::end(), PLearn::endl(), PLearn::Set::find(), PLearn::DoubleAccessSparseMatrix< real >::get(), PLearn::WordNetOntology::getAllWords(), PLearn::DoubleAccessSparseMatrix< real >::getCol(), getDeepestCommonAncestor(), PLearn::WordNetOntology::getSenseKey(), PLearn::WordNetOntology::getSynsetIDForSenseKey(), PLearn::WordNetOntology::getWordId(), PLearn::WordNetOntology::getWordNounSenses(), PLearn::ProbSparseMatrix::incr(), PLearn::ShellProgressBar::init(), INIT_P_A, PLearn::WordNetOntology::isSense(), PLearn::WordNetOntology::isWord(), PLearn::VMat::length(), PLearn::loadToVMat(), PLearn::log(), n_fields, nEF, nES, nFS, PLearn::ProbVector::normalize(), PLearn::ProbSparseMatrix::normalizeCond(), PLearn::ProbSparseMatrix::normalizeJoint(), NOUN_TYPE, nSE, ontology, OOV_TAG, pA, pE, pEF, pES, pF, pFS, PLERROR, PLearn::WordNetOntology::printSynset(), pS, pSE, pTC, PLearn::TVec< T >::resize(), semcor_test_path, semcor_train_path, semcor_valid2_path, semcor_valid_path, sens_to_conceptAncestors, sensemap, sensemap_level, senseval2_train, senseval2_train_path, PLearn::ProbSparseMatrix::set(), PLearn::ShellProgressBar::set(), PLearn::SetIterator, PLearn::TVec< T >::size(), PLearn::ProbVector::smoothNormalize(), source_wsd_voc_size, ss_size, PLearn::DoubleAccessSparseMatrix< real >::sumCol(), target_id_to_word, target_word_to_senses, target_wsd_voc, target_wsd_voc_size, train_bitext_src, train_bitext_tgt, PLearn::ShellProgressBar::update(), window_size, wsd_test, wsd_train, wsd_valid, and wsd_valid2.

Referenced by build_().

void PLearn::GraphicalBiText::init_WSD  )  [private]
 

Definition at line 405 of file GraphicalBiText.cc.

References PLearn::WordNetOntology::getSenseKey(), PLearn::WordNetOntology::getSynsetIDForSenseKey(), PLearn::WordNetOntology::getWordId(), PLearn::ProbSparseMatrix::incr(), PLearn::WordNetOntology::isSense(), PLearn::WordNetOntology::isWord(), k, PLearn::VMat::length(), n_fields, nESbase, nHS, PLearn::SmoothedProbSparseMatrix::normalizeCondBackoff(), NOUN_TYPE, ontology, OOV_TAG, pEbase, pESbase, pESupbi, pH, pHbase, pHS, pHSupbi, pSbase, PLearn::TVec< T >::resize(), sensemap, PLearn::ProbVector::smoothNormalize(), window_size, and wsd_train.

Referenced by build_().

void PLearn::GraphicalBiText::loadBitext string  train_file_name,
string  valid_file_name,
bool  update_voc
[private]
 

Definition at line 261 of file GraphicalBiText.cc.

References PLearn::ShellProgressBar::done(), PLearn::ShellProgressBar::draw(), PLearn::ShellProgressBar::init(), OOV_TAG, PLERROR, PLearn::TVec< T >::resize(), PLearn::ShellProgressBar::set(), source_word_to_id, PLearn::split(), target_id_to_word, target_voc_size, target_word_to_id, PLearn::tostring(), train_bitext_src, train_bitext_tgt, PLearn::ShellProgressBar::update(), valid_bitext_src, and valid_bitext_tgt.

Referenced by build_().

void PLearn::GraphicalBiText::loadSensemap string  sensemap_file  ) 
 

Definition at line 2355 of file GraphicalBiText.cc.

References PLearn::pgetline(), sensemap, and PLearn::split().

void PLearn::GraphicalBiText::optimize_interp_parameter Vec  tgt,
Vec  src,
string  name
[private]
 

PLearn::GraphicalBiText::PLEARN_DECLARE_OBJECT GraphicalBiText   ) 
 

void PLearn::GraphicalBiText::print string  name  ) 
 

Definition at line 1258 of file GraphicalBiText.cc.

References PLearn::Set::begin(), compute_BN_likelihood(), compute_efs_likelihood(), PLearn::ShellProgressBar::done(), PLearn::ShellProgressBar::draw(), PLearn::Set::end(), PLearn::endl(), PLearn::WordNetOntology::getAllCategories(), PLearn::WordNetOntology::getAllWords(), PLearn::WordNetOntology::getSenseKey(), PLearn::WordNetOntology::getSensesForWord(), PLearn::WordNetOntology::getVocSize(), PLearn::ShellProgressBar::init(), k, ontology, output_dir, PLERROR, PROB_PREC, PLearn::SetIterator, PLearn::TVec< T >::size(), source_id_to_word, target_id_to_word, target_wsd_voc_size, and PLearn::ShellProgressBar::update().

void PLearn::GraphicalBiText::print_sensemap  )  [private]
 

Definition at line 1076 of file GraphicalBiText.cc.

References PLearn::Set::begin(), PLearn::Set::end(), PLearn::endl(), PLearn::WordNetOntology::getAllWords(), PLearn::WordNetOntology::getWordSenses(), ontology, PLearn::SetIterator, and source_id_to_word.

void PLearn::GraphicalBiText::printHierarchy string  name  ) 
 

Definition at line 1302 of file GraphicalBiText.cc.

References PLERROR, printNode(), and ROOT_SS_ID.

void PLearn::GraphicalBiText::printNode int  ss,
ostream &  out_hie
[private]
 

Definition at line 1314 of file GraphicalBiText.cc.

References PLearn::Set::begin(), PLearn::Node::children, PLearn::color(), PLearn::Set::end(), PLearn::endl(), PLearn::DoubleAccessSparseMatrix< real >::get(), PLearn::WordNetOntology::getSynset(), PLearn::WordNetOntology::getSynsetWordDescendants(), PLearn::Node::gloss, ontology, pA, pC, pES, pFS, pMC, printNode(), pS, pTC, PLearn::SetIterator, source_id_to_word, PLearn::Node::syns, target_id_to_word, and target_wsd_voc.

Referenced by printHierarchy(), and printNode().

void PLearn::GraphicalBiText::sensetag_valid_bitext string  name  ) 
 

Definition at line 1515 of file GraphicalBiText.cc.

References compute_efs_likelihood(), PLearn::ShellProgressBar::done(), PLearn::ShellProgressBar::draw(), PLearn::Set::end(), PLearn::endl(), PLearn::Set::find(), PLearn::WordNetOntology::getSensesForWord(), PLearn::ShellProgressBar::init(), PLearn::WordNetOntology::isWord(), k, ontology, output_dir, PLERROR, PLearn::TVec< T >::size(), source_id_to_word, target_id_to_word, target_wsd_voc, PLearn::ShellProgressBar::update(), valid_bitext_src, and valid_bitext_tgt.

void PLearn::GraphicalBiText::senseTagBitext string  name  ) 
 

Definition at line 1467 of file GraphicalBiText.cc.

References compute_efs_likelihood(), PLearn::ShellProgressBar::done(), PLearn::ShellProgressBar::draw(), PLearn::Set::end(), PLearn::endl(), PLearn::Set::find(), PLearn::WordNetOntology::getSenseKey(), PLearn::WordNetOntology::getSensesForWord(), PLearn::ShellProgressBar::init(), PLearn::WordNetOntology::isWord(), k, ontology, output_dir, PLERROR, PLearn::TVec< T >::size(), source_id_to_word, target_id_to_word, target_wsd_voc, train_bitext_src, train_bitext_tgt, and PLearn::ShellProgressBar::update().

void PLearn::GraphicalBiText::set_nodemap int  node,
int  word
[private]
 

Definition at line 1040 of file GraphicalBiText.cc.

References PLearn::Set::begin(), PLearn::Node::children, PLearn::Set::end(), PLearn::endl(), PLearn::Set::find(), PLearn::WordNetOntology::getSenseKey(), PLearn::WordNetOntology::getSynset(), PLearn::WordNetOntology::getWordSenses(), PLearn::WordNetOntology::isSynset(), ontology, pSE, pTC, sensemap, and PLearn::SetIterator.

Referenced by compute_nodemap().

void PLearn::GraphicalBiText::setTrainingSet VMat  training_set,
bool  call_forget
 

Definition at line 2432 of file GraphicalBiText.cc.

void PLearn::GraphicalBiText::test  ) 
 

Definition at line 2427 of file GraphicalBiText.cc.

void PLearn::GraphicalBiText::test_WSD VMat  wsd_test,
string  name,
TVec< string v,
bool  select,
real  interp = DEF_INTERP
 

Definition at line 1669 of file GraphicalBiText.cc.

References ADJ_TYPE, ADV_TYPE, PLearn::Set::begin(), BiSelect, PLearn::ShellProgressBar::done(), PLearn::ShellProgressBar::draw(), PLearn::Set::end(), PLearn::endl(), PLearn::DoubleAccessSparseMatrix< real >::get(), PLearn::SmoothedProbSparseMatrix::get(), PLearn::WordNetOntology::getAllWords(), PLearn::WordNetOntology::getSenseKey(), PLearn::WordNetOntology::getSensesForWord(), PLearn::WordNetOntology::getSynsetIDForSenseKey(), PLearn::WordNetOntology::getWordId(), PLearn::ShellProgressBar::init(), PLearn::WordNetOntology::isWord(), k, PLearn::VMat::length(), PLearn::log(), PLearn::max(), n_fields, NOUN_TYPE, ontology, OOV_TAG, output_dir, pES, pESbase, pHS, pHSupbi, PLERROR, pSbase, PLearn::TVec< T >::resize(), PLearn::select(), sensemap, sensemap_level, PLearn::ShellProgressBar::set(), PLearn::SetIterator, PLearn::TVec< T >::size(), source_id_to_word, source_wsd_voc_size, PLearn::WordNetOntology::temp_word_to_adj_senses, PLearn::WordNetOntology::temp_word_to_adv_senses, PLearn::WordNetOntology::temp_word_to_noun_senses, PLearn::WordNetOntology::temp_word_to_verb_senses, UNDEFINED_TYPE, PLearn::ShellProgressBar::update(), VERB_TYPE, and window_size.

Referenced by train().

void PLearn::GraphicalBiText::train int  n_epoch  ) 
 

void PLearn::GraphicalBiText::train VMat  training_set  )  [virtual]
 

*** SUBCLASS WRITING: *** Does the actual training. Subclasses must implement this method. The method should upon entry, call setTrainingSet(training_set); Make sure that a if(measure(step, objective_value)) is done after each training step, and that training is stopped if it returned true

Implements PLearn::Learner.

Definition at line 2380 of file GraphicalBiText.cc.

References check_consitency(), compute_train_likelihood(), compute_valid_likelihood(), PLearn::VMat::length(), n_epoch, test_WSD(), PLearn::tostring(), update_WSD_model(), wsd_test, wsd_train, wsd_valid, and wsd_valid2.

void PLearn::GraphicalBiText::update_pWS ProbSparseMatrix ,
int  ,
string 
[private]
 

void PLearn::GraphicalBiText::update_WSD_model string  name  ) 
 

Definition at line 1378 of file GraphicalBiText.cc.

References PLearn::TVec< T >::clear(), PLearn::DoubleAccessSparseMatrix< real >::clear(), compute_efs_likelihood(), PLearn::ShellProgressBar::done(), PLearn::ShellProgressBar::draw(), PLearn::Set::end(), PLearn::endl(), PLearn::Set::find(), PLearn::DoubleAccessSparseMatrix< real >::getCol(), PLearn::WordNetOntology::getSenseKey(), PLearn::WordNetOntology::getSensesForWord(), PLearn::DoubleAccessSparseMatrix< real >::getWidth(), PLearn::ProbSparseMatrix::incr(), PLearn::ShellProgressBar::init(), PLearn::WordNetOntology::isWord(), k, nESbase, nESupbi, nHSupbi, PLearn::SmoothedProbSparseMatrix::normalizeCondBackoff(), ontology, output_dir, pEbase, pESupbi, pHSupbi, pHupbi, PLERROR, sensemap, PLearn::ProbSparseMatrix::set(), PLearn::TVec< T >::size(), PLearn::ProbVector::smoothNormalize(), source_id_to_word, source_word_to_id, target_id_to_word, target_wsd_voc, PLearn::tostring(), train_bitext_src, train_bitext_tgt, PLearn::ShellProgressBar::update(), update_threshold, and window_size.

Referenced by train().

void PLearn::GraphicalBiText::use const Vec input,
Vec output
[inline, virtual]
 

*** SUBCLASS WRITING: *** Uses a trained decider on input, filling output. If the cost should also be computed, then the user should call useAndCost instead of this method.

Implements PLearn::Learner.

Definition at line 215 of file GraphicalBiText.h.

References PLERROR.


Member Data Documentation

real PLearn::GraphicalBiText::alpha_bn [private]
 

Definition at line 175 of file GraphicalBiText.h.

Referenced by build_(), and compute_likelihood().

real PLearn::GraphicalBiText::alpha_joint [private]
 

Definition at line 176 of file GraphicalBiText.h.

Referenced by build_(), and compute_likelihood().

map<int,bool> PLearn::GraphicalBiText::BiSelect [private]
 

Definition at line 115 of file GraphicalBiText.h.

Referenced by build_(), and test_WSD().

TMat<Set> PLearn::GraphicalBiText::commNode [private]
 

Definition at line 91 of file GraphicalBiText.h.

Referenced by build_(), compute_BN_likelihood(), compute_efs_likelihood(), and init().

string PLearn::GraphicalBiText::key_file
 

Definition at line 47 of file GraphicalBiText.h.

Vec PLearn::GraphicalBiText::KL [private]
 

Definition at line 113 of file GraphicalBiText.h.

Referenced by build_(), and computeKL().

int PLearn::GraphicalBiText::n_epoch
 

Definition at line 41 of file GraphicalBiText.h.

Referenced by train().

int PLearn::GraphicalBiText::n_fields [private]
 

Definition at line 124 of file GraphicalBiText.h.

Referenced by init(), init_WSD(), and test_WSD().

int PLearn::GraphicalBiText::n_test_examples
 

Definition at line 40 of file GraphicalBiText.h.

int PLearn::GraphicalBiText::n_train_examples
 

Definition at line 39 of file GraphicalBiText.h.

Vec PLearn::GraphicalBiText::nA [private]
 

Definition at line 80 of file GraphicalBiText.h.

Referenced by build_(), compute_BN_likelihood(), and compute_likelihood().

ProbSparseMatrix PLearn::GraphicalBiText::nEF [private]
 

Definition at line 105 of file GraphicalBiText.h.

Referenced by build_(), and init().

ProbSparseMatrix PLearn::GraphicalBiText::nES [private]
 

Definition at line 86 of file GraphicalBiText.h.

Referenced by build_(), compute_BN_likelihood(), compute_likelihood(), and init().

ProbSparseMatrix PLearn::GraphicalBiText::nESbase [private]
 

Definition at line 135 of file GraphicalBiText.h.

Referenced by build_(), init_WSD(), and update_WSD_model().

ProbSparseMatrix PLearn::GraphicalBiText::nESupbi [private]
 

Definition at line 136 of file GraphicalBiText.h.

Referenced by build_(), and update_WSD_model().

ProbSparseMatrix PLearn::GraphicalBiText::nFS [private]
 

Definition at line 83 of file GraphicalBiText.h.

Referenced by build_(), compute_BN_likelihood(), compute_likelihood(), and init().

ProbSparseMatrix PLearn::GraphicalBiText::nHS [private]
 

Definition at line 141 of file GraphicalBiText.h.

Referenced by build_(), and init_WSD().

ProbSparseMatrix PLearn::GraphicalBiText::nHSupbi [private]
 

Definition at line 143 of file GraphicalBiText.h.

Referenced by build_(), and update_WSD_model().

map<int,int> PLearn::GraphicalBiText::node_level [private]
 

Definition at line 120 of file GraphicalBiText.h.

Referenced by compute_node_level().

map<int,int> PLearn::GraphicalBiText::nodemap [private]
 

Definition at line 119 of file GraphicalBiText.h.

Referenced by compute_nodemap().

Vec PLearn::GraphicalBiText::nS [private]
 

Definition at line 129 of file GraphicalBiText.h.

Referenced by build_(), compute_BN_likelihood(), and compute_likelihood().

ProbSparseMatrix PLearn::GraphicalBiText::nSE [private]
 

Definition at line 109 of file GraphicalBiText.h.

Referenced by build_(), and init().

ProbSparseMatrix PLearn::GraphicalBiText::nSEbi [private]
 

Definition at line 111 of file GraphicalBiText.h.

Referenced by build_(), compute_BN_likelihood(), and compute_likelihood().

WordNetOntology PLearn::GraphicalBiText::ontology [private]
 

Definition at line 147 of file GraphicalBiText.h.

Referenced by build_(), check_set_pA(), compute_BN_likelihood(), compute_efs_likelihood(), compute_likelihood(), compute_node_level(), compute_nodemap(), compute_pMC(), compute_pTC(), computeKL(), distribute_pS_on_ancestors(), getDeepestCommonAncestor(), init(), init_WSD(), print(), print_sensemap(), printNode(), sensetag_valid_bitext(), senseTagBitext(), set_nodemap(), test_WSD(), and update_WSD_model().

string PLearn::GraphicalBiText::output_dir
 

Definition at line 66 of file GraphicalBiText.h.

Referenced by print(), sensetag_valid_bitext(), senseTagBitext(), test_WSD(), and update_WSD_model().

Vec PLearn::GraphicalBiText::pA [private]
 

Definition at line 79 of file GraphicalBiText.h.

Referenced by build_(), check_consitency(), check_set_pA(), compute_BN_likelihood(), compute_likelihood(), compute_pMC(), init(), and printNode().

Vec PLearn::GraphicalBiText::pC [private]
 

Definition at line 75 of file GraphicalBiText.h.

Referenced by build_(), check_consitency(), compute_BN_likelihood(), compute_efs_likelihood(), compute_pMC(), and printNode().

ProbVector PLearn::GraphicalBiText::pE [private]
 

Definition at line 102 of file GraphicalBiText.h.

Referenced by build_(), check_consitency(), compute_likelihood(), and init().

ProbVector PLearn::GraphicalBiText::pEbase [private]
 

Definition at line 126 of file GraphicalBiText.h.

Referenced by build_(), init_WSD(), and update_WSD_model().

ProbSparseMatrix PLearn::GraphicalBiText::pEF [private]
 

Definition at line 106 of file GraphicalBiText.h.

Referenced by build_(), check_consitency(), compute_likelihood(), and init().

ProbSparseMatrix PLearn::GraphicalBiText::pES [private]
 

Definition at line 87 of file GraphicalBiText.h.

Referenced by build_(), check_consitency(), compute_BN_likelihood(), compute_efs_likelihood(), compute_likelihood(), init(), printNode(), and test_WSD().

SmoothedProbSparseMatrix PLearn::GraphicalBiText::pESbase [private]
 

Definition at line 137 of file GraphicalBiText.h.

Referenced by build_(), init_WSD(), and test_WSD().

SmoothedProbSparseMatrix PLearn::GraphicalBiText::pESupbi [private]
 

Definition at line 138 of file GraphicalBiText.h.

Referenced by build_(), init_WSD(), and update_WSD_model().

ProbVector PLearn::GraphicalBiText::pF [private]
 

Definition at line 100 of file GraphicalBiText.h.

Referenced by build_(), check_consitency(), compute_likelihood(), and init().

ProbSparseMatrix PLearn::GraphicalBiText::pFS [private]
 

Definition at line 84 of file GraphicalBiText.h.

Referenced by build_(), check_consitency(), compute_BN_likelihood(), compute_efs_likelihood(), compute_likelihood(), init(), and printNode().

ProbVector PLearn::GraphicalBiText::pH [private]
 

Definition at line 131 of file GraphicalBiText.h.

Referenced by build_(), check_consitency(), and init_WSD().

ProbVector PLearn::GraphicalBiText::pHbase [private]
 

Definition at line 132 of file GraphicalBiText.h.

Referenced by build_(), and init_WSD().

SmoothedProbSparseMatrix PLearn::GraphicalBiText::pHS [private]
 

Definition at line 142 of file GraphicalBiText.h.

Referenced by build_(), check_consitency(), init_WSD(), and test_WSD().

SmoothedProbSparseMatrix PLearn::GraphicalBiText::pHSupbi [private]
 

Definition at line 144 of file GraphicalBiText.h.

Referenced by build_(), check_consitency(), init_WSD(), test_WSD(), and update_WSD_model().

ProbVector PLearn::GraphicalBiText::pHupbi [private]
 

Definition at line 133 of file GraphicalBiText.h.

Referenced by build_(), check_consitency(), and update_WSD_model().

ProbVector PLearn::GraphicalBiText::pMC [private]
 

Definition at line 74 of file GraphicalBiText.h.

Referenced by build_(), check_consitency(), compute_node_level(), compute_pMC(), and printNode().

ProbVector PLearn::GraphicalBiText::pS [private]
 

Definition at line 72 of file GraphicalBiText.h.

Referenced by build_(), check_consitency(), check_set_pA(), compute_BN_likelihood(), compute_efs_likelihood(), compute_likelihood(), compute_pTC(), init(), and printNode().

ProbVector PLearn::GraphicalBiText::pSbase [private]
 

Definition at line 127 of file GraphicalBiText.h.

Referenced by build_(), check_consitency(), init_WSD(), and test_WSD().

ProbSparseMatrix PLearn::GraphicalBiText::pSE [private]
 

Definition at line 110 of file GraphicalBiText.h.

Referenced by build_(), compute_nodemap(), computeKL(), init(), and set_nodemap().

ProbSparseMatrix PLearn::GraphicalBiText::pSEbi [private]
 

Definition at line 112 of file GraphicalBiText.h.

Referenced by build_(), compute_likelihood(), and computeKL().

ProbVector PLearn::GraphicalBiText::pSupbi [private]
 

Definition at line 128 of file GraphicalBiText.h.

Referenced by build_().

Vec PLearn::GraphicalBiText::pTC [private]
 

Definition at line 77 of file GraphicalBiText.h.

Referenced by build_(), check_consitency(), check_set_pA(), compute_BN_likelihood(), compute_efs_likelihood(), compute_node_level(), compute_nodemap(), compute_pMC(), compute_pTC(), distribute_pS_on_ancestors(), getDeepestCommonAncestor(), init(), printNode(), and set_nodemap().

string PLearn::GraphicalBiText::semcor_test_path
 

Definition at line 53 of file GraphicalBiText.h.

Referenced by init().

string PLearn::GraphicalBiText::semcor_train_path
 

Definition at line 50 of file GraphicalBiText.h.

Referenced by init().

string PLearn::GraphicalBiText::semcor_valid2_path
 

Definition at line 52 of file GraphicalBiText.h.

Referenced by init().

string PLearn::GraphicalBiText::semcor_valid_path
 

Definition at line 51 of file GraphicalBiText.h.

Referenced by init().

map<int, Set> PLearn::GraphicalBiText::sens_to_conceptAncestors [private]
 

Definition at line 93 of file GraphicalBiText.h.

Referenced by init().

int PLearn::GraphicalBiText::sense_size [private]
 

Definition at line 149 of file GraphicalBiText.h.

Referenced by build_().

map<string,string> PLearn::GraphicalBiText::sensemap [private]
 

Definition at line 118 of file GraphicalBiText.h.

Referenced by compute_nodemap(), init(), init_WSD(), loadSensemap(), set_nodemap(), test_WSD(), and update_WSD_model().

string PLearn::GraphicalBiText::sensemap_file
 

Definition at line 48 of file GraphicalBiText.h.

int PLearn::GraphicalBiText::sensemap_level
 

Definition at line 49 of file GraphicalBiText.h.

Referenced by init(), and test_WSD().

VMat PLearn::GraphicalBiText::senseval2_train
 

Definition at line 62 of file GraphicalBiText.h.

Referenced by init().

string PLearn::GraphicalBiText::senseval2_train_path
 

Definition at line 54 of file GraphicalBiText.h.

Referenced by init().

map<int, string> PLearn::GraphicalBiText::source_id_to_word [private]
 

Definition at line 154 of file GraphicalBiText.h.

Referenced by build_(), compute_likelihood(), print(), print_sensemap(), printNode(), sensetag_valid_bitext(), senseTagBitext(), test_WSD(), and update_WSD_model().

string PLearn::GraphicalBiText::source_path
 

Definition at line 42 of file GraphicalBiText.h.

Referenced by build_().

string PLearn::GraphicalBiText::source_voc
 

Definition at line 43 of file GraphicalBiText.h.

Referenced by build_().

int PLearn::GraphicalBiText::source_voc_size [private]
 

Definition at line 156 of file GraphicalBiText.h.

Referenced by build_().

map<string, int> PLearn::GraphicalBiText::source_word_to_id [private]
 

Definition at line 155 of file GraphicalBiText.h.

Referenced by build_(), loadBitext(), and update_WSD_model().

int PLearn::GraphicalBiText::source_wsd_voc_size [private]
 

Definition at line 148 of file GraphicalBiText.h.

Referenced by build_(), compute_likelihood(), init(), and test_WSD().

int PLearn::GraphicalBiText::ss_size [private]
 

Definition at line 150 of file GraphicalBiText.h.

Referenced by build_(), compute_BN_likelihood(), compute_efs_likelihood(), compute_likelihood(), and init().

Vec PLearn::GraphicalBiText::sum_cpC [private]
 

Definition at line 181 of file GraphicalBiText.h.

Referenced by build_().

Vec PLearn::GraphicalBiText::sum_epEC [private]
 

Definition at line 179 of file GraphicalBiText.h.

Referenced by build_(), and compute_BN_likelihood().

Vec PLearn::GraphicalBiText::sum_fpFC [private]
 

Definition at line 180 of file GraphicalBiText.h.

Referenced by build_(), and compute_BN_likelihood().

map<int,real> PLearn::GraphicalBiText::target_id_to_proba [private]
 

Definition at line 161 of file GraphicalBiText.h.

map<int, string> PLearn::GraphicalBiText::target_id_to_word [private]
 

Definition at line 159 of file GraphicalBiText.h.

Referenced by build_(), compute_likelihood(), init(), loadBitext(), print(), printNode(), sensetag_valid_bitext(), senseTagBitext(), and update_WSD_model().

string PLearn::GraphicalBiText::target_voc
 

Definition at line 44 of file GraphicalBiText.h.

Referenced by build_().

int PLearn::GraphicalBiText::target_voc_size [private]
 

Definition at line 162 of file GraphicalBiText.h.

Referenced by build_(), and loadBitext().

map<string, int> PLearn::GraphicalBiText::target_word_to_id [private]
 

Definition at line 160 of file GraphicalBiText.h.

Referenced by build_(), and loadBitext().

map<int, Set> PLearn::GraphicalBiText::target_word_to_senses [private]
 

Definition at line 96 of file GraphicalBiText.h.

Referenced by compute_BN_likelihood(), compute_efs_likelihood(), and init().

Set PLearn::GraphicalBiText::target_wsd_voc [private]
 

Definition at line 164 of file GraphicalBiText.h.

Referenced by build_(), compute_likelihood(), init(), printNode(), sensetag_valid_bitext(), senseTagBitext(), and update_WSD_model().

int PLearn::GraphicalBiText::target_wsd_voc_size [private]
 

Definition at line 165 of file GraphicalBiText.h.

Referenced by build_(), compute_likelihood(), init(), and print().

Vec PLearn::GraphicalBiText::train_bitext_src [private]
 

Definition at line 169 of file GraphicalBiText.h.

Referenced by compute_train_likelihood(), init(), loadBitext(), senseTagBitext(), and update_WSD_model().

Vec PLearn::GraphicalBiText::train_bitext_tgt [private]
 

Definition at line 168 of file GraphicalBiText.h.

Referenced by compute_train_likelihood(), init(), loadBitext(), senseTagBitext(), and update_WSD_model().

string PLearn::GraphicalBiText::train_file
 

Definition at line 45 of file GraphicalBiText.h.

Referenced by build_().

real PLearn::GraphicalBiText::update_threshold
 

Definition at line 64 of file GraphicalBiText.h.

Referenced by update_WSD_model().

Vec PLearn::GraphicalBiText::valid_bitext_src [private]
 

Definition at line 171 of file GraphicalBiText.h.

Referenced by compute_valid_likelihood(), loadBitext(), and sensetag_valid_bitext().

Vec PLearn::GraphicalBiText::valid_bitext_tgt [private]
 

Definition at line 170 of file GraphicalBiText.h.

Referenced by compute_valid_likelihood(), loadBitext(), and sensetag_valid_bitext().

string PLearn::GraphicalBiText::valid_file
 

Definition at line 46 of file GraphicalBiText.h.

Referenced by build_().

int PLearn::GraphicalBiText::window_size
 

Definition at line 38 of file GraphicalBiText.h.

Referenced by init(), init_WSD(), test_WSD(), and update_WSD_model().

VMat PLearn::GraphicalBiText::wsd_test
 

Definition at line 61 of file GraphicalBiText.h.

Referenced by init(), and train().

VMat PLearn::GraphicalBiText::wsd_train
 

Definition at line 58 of file GraphicalBiText.h.

Referenced by init(), init_WSD(), and train().

VMat PLearn::GraphicalBiText::wsd_valid
 

Definition at line 59 of file GraphicalBiText.h.

Referenced by init(), and train().

VMat PLearn::GraphicalBiText::wsd_valid2
 

Definition at line 60 of file GraphicalBiText.h.

Referenced by init(), and train().


The documentation for this class was generated from the following files:
Generated on Tue Aug 17 16:27:35 2004 for PLearn by doxygen 1.3.7